question: public static byte [ ] toByteArray ( InputStream inputStream , final int size ) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; long length = size == - 1 ? Long . MAX_VALUE : size ; pipe ( inputStream , out , length ) ; return out . toByteArray ( ) ; }
target:  Converts (a portion) of the given stream to a byte array.