public static void write ( InputStream in , OutputStream out ) throws IOException { byte [ ] b = new byte [ 4096 ] ; for ( int n ; ( n = in . read ( b ) ) != - 1 ; ) { out . write ( b , 0 , n ) ; } in . close ( ) ; out . close ( ) ; }
Utility method to copy a stream to another stream .