Here you can find the source of copyLarge(Reader input, Writer output)
private static long copyLarge(Reader input, Writer output) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; private static long copyLarge(Reader input, Writer output) throws IOException { char[] buffer = new char[DEFAULT_BUFFER_SIZE]; long count = 0; int n = 0; while (-1 != (n = input.read(buffer))) { output.write(buffer, 0, n);/*from w ww . j a v a 2 s . c o m*/ count += n; } return count; } private static long copyLarge(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; long count = 0; int n = 0; while (-1 != (n = input.read(buffer))) { output.write(buffer, 0, n); count += n; } return count; } }