question: public static byte [ ] readData ( final InputStream input ) throws IOException { final byte [ ] inputBuffer = new byte [ BUFFER_LENGTH ] ; final ByteArrayOutputStream byteOutput = new ByteArrayOutputStream ( BUFFER_LENGTH ) ; int bytesRead ; while ( ( bytesRead = input . read ( inputBuffer ) ) != - 1 ) { byteOutput . write ( inputBuffer , 0 , bytesRead ) ; } final byte [ ] r = byteOutput . toByteArray ( ) ; byteOutput . close ( ) ; return r ; }
target:  Reads all the data from the supplied InputStream into a byte array.