code: public static void copyStream(InputStream is, OutputStream os, int size) 
  	throws IOException {
  		byte[] buffer = new byte[size];
  		for (int r = -1; (r = is.read(buffer, 0, size)) != -1;) {
  			os.write(buffer, 0, r);
  		}
  	}
docs: Write all bytes from is to os. Does not close either stream.
  @param is to copy bytes from
  @param os to copy bytes to
  @param size number of bytes to buffer between read and write operations
  @throws IOException for usual reasons