Java tutorial
//package com.java2s; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; public class Main { /** * Copy. * * @param in the in * @param out the out * @throws IOException Signals that an I/O exception has occurred. */ private static void copy(InputStream in, BufferedOutputStream out) throws IOException { int byte_; while ((byte_ = in.read()) != -1) out.write(byte_); } }