src/com/esotericsoftware/scar/Scar.java
static public void copyStream (InputStream input, OutputStream output) throws IOException {
		if (input == null) throw new IllegalArgumentException("input cannot be null.");
		if (output == null) throw new IllegalArgumentException("output cannot be null.");

		try {
			byte[] buffer = new byte[4096];
			while (true) {
				int length = input.read(buffer);
				if (length == -1) break;
				output.write(buffer, 0, length);
			}
		} finally {
			try {
				input.close();
			} catch (Exception ignored) {
			}
		}
	}
/** Reads to the end of the input stream and writes the bytes to the output stream. The input stream is closed, the output is
	 * not. */
Reads to the end of the input stream and writes the bytes to the output stream. The input stream is closed, the output is
not.
Reads to the end of the input stream and writes the bytes to the output stream . The input stream is closed the output is not .
static public void copyStream (InputStream input, OutputStream output) throws IOException {
		if (input == null) throw new IllegalArgumentException("input cannot be null.");
		if (output == null) throw new IllegalArgumentException("output cannot be null.");
		try {
			byte[] buffer = new byte[4096];
			while (true) {
				int length = input.read(buffer);
				if (length == -1) break;
				output.write(buffer, 0, length);
			}
		} finally {
			try {
				input.close();
			} catch (Exception ignored) {
			}
		}
	}
static public void copyStream ( InputStream input , OutputStream output ) throws IOException { if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; try { byte [ ] buffer = new byte [ 4096 ] ; while ( true ) { int length = input . read ( buffer ) ; if ( length == - 1 ) break ; output . write ( buffer , 0 , length ) ; } } finally { try { input . close ( ) ; } catch ( Exception ignored ) { } } }
Reads to the end of the input stream and writes the bytes to the output stream.
Reads to the end of the input stream and writes the bytes to the output stream .