Here you can find the source of copyLarge(InputStream input, OutputStream output)
public static long copyLarge(InputStream input, OutputStream output) throws IOException
//package com.java2s; /*//from w w w .java2 s. c o m * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Main { /** * @see org.mule.util.IOUtils#copyLarge */ public static long copyLarge(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[1024 * 4]; long count = 0; int n = 0; while (-1 != (n = input.read(buffer))) { output.write(buffer, 0, n); count += n; } return count; } }