code: static public void copyStream(Reader reader, Writer writer, int transferBufferSize) throws IOException {
  		if( transferBufferSize < 1 ) {
  			throw new IOException("Transfer buffer size can not be smaller than 1");
  		}
  
  		char[] buffer = new char[transferBufferSize];
  
  		int bytesRead = reader.read(buffer);
  		while( bytesRead >= 0 ) {
  			writer.write(buffer, 0, bytesRead);
  
  			bytesRead = reader.read(buffer);
  		}
  	}
docs: Copy all the characters from a reader to a writer.
  @param reader Input character stream
  @param writer Output character stream
  @param transferBufferSize Size of character buffer used to transfer characters from
  one stream to the other
  @throws IOException