question: static int copyBytes ( OutputStream os , InputStream is , byte [ ] ioBuffer , int maxSize ) throws IOException { int totalSize = 0 ; while ( totalSize < maxSize ) { int rc = is . read ( ioBuffer , 0 , Math . min ( maxSize - totalSize , ioBuffer . length ) ) ; if ( rc == - 1 ) { break ; } os . write ( ioBuffer , 0 , rc ) ; totalSize += rc ; } return totalSize ; }
target:  Pumps all the bytes (but no more that maxSize) from given input stream through ioBuffer to given output stream and returns number of moved bytes.