question: public static int copy ( InputStream in , OutputStream out ) throws IOException { Assert . notNull ( in , "No InputStream specified" ) ; Assert . notNull ( out , "No OutputStream specified" ) ; int byteCount = 0 ; byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int bytesRead = - 1 ; while ( ( bytesRead = in . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0 , bytesRead ) ; byteCount += bytesRead ; } out . flush ( ) ; return byteCount ; }
target:  Copy the contents of the given InputStream to the given OutputStream. Leaves both streams open when done.