elk-util-parent/elk-util-io/src/main/java/org/semanticweb/elk/io/IOUtils.java
public static int copy(InputStream input, OutputStream output)
			throws IOException {
		byte[] buffer = new byte[BUFFER_SIZE];

		BufferedInputStream in = new BufferedInputStream(input, BUFFER_SIZE);
		BufferedOutputStream out = new BufferedOutputStream(output, BUFFER_SIZE);
		int count = 0, n = 0;

		try {
			while ((n = in.read(buffer, 0, BUFFER_SIZE)) != -1) {
				out.write(buffer, 0, n);
				count += n;
			}
			out.flush();
		} finally {
			IOUtils.closeQuietly(in);
			IOUtils.closeQuietly(out);
		}

		return count;
	}
public static int copy(InputStream input, OutputStream output)
			throws IOException {
		byte[] buffer = new byte[BUFFER_SIZE];

		BufferedInputStream in = new BufferedInputStream(input, BUFFER_SIZE);
		BufferedOutputStream out = new BufferedOutputStream(output, BUFFER_SIZE);
		int count = 0, n = 0;

		try {
			while ((n = in.read(buffer, 0, BUFFER_SIZE)) != -1) {
				out.write(buffer, 0, n);
				count += n;
			}
			out.flush();
		} finally {
			IOUtils.closeQuietly(in);
			IOUtils.closeQuietly(out);
		}

		return count;
	}
public static int copy ( InputStream input , OutputStream output ) throws IOException { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; BufferedInputStream in = new BufferedInputStream ( input , BUFFER_SIZE ) ; BufferedOutputStream out = new BufferedOutputStream ( output , BUFFER_SIZE ) ; int count = 0 , n = 0 ; try { while ( ( n = in . read ( buffer , 0 , BUFFER_SIZE ) ) != - 1 ) { out . write ( buffer , 0 , n ) ; count += n ; } out . flush ( ) ; } finally { IOUtils . closeQuietly ( in ) ; IOUtils . closeQuietly ( out ) ; } return count ; }
Copies bytes from the input stream to the output stream

@param input
@param output

@return The number of bytes copied
@throws IOException
Copies bytes from the input stream to the output stream