public static void copy ( InputStream from , OutputStream to , int bufferSize ) throws IOException { byte [ ] buffer = new byte [ bufferSize ] ; int read ; while ( ( read = from . read ( buffer ) ) > - 1 ) { to . write ( buffer , 0 , read ) ; } }
Copies an input stream to another stream