question: public static long copy ( InputStream from , OutputStream to ) throws IOException { checkNotNull ( from ) ; checkNotNull ( to ) ; byte [ ] buf = new byte [ BUF_SIZE ] ; long total = 0 ; while ( true ) { int r = from . read ( buf ) ; if ( r == - 1 ) { break ; } to . write ( buf , 0 , r ) ; total += r ; } return total ; }
target:  Copies all bytes from the input stream to the output stream. Does not close or flush either stream.