code: public static void copy(final InputStream in, final OutputStream out, final int bufferSize)
  			throws IOException {
  		final byte[] buf = new byte[bufferSize];
  		int bytesRead = in.read(buf);
  
  		while (bytesRead != -1) {
  			out.write(buf, 0, bytesRead);
  			bytesRead = in.read(buf);
  		}
  
  		out.flush();
  	}
docs: Copies information from the input stream to the output stream using a specified buffer size.
  
  @param in the source stream.
  @param out the destination stream.
  @param bufferSize the buffer size.
  @throws IOException if there is an error reading or writing to the streams.