question: protected static byte [ ] readAll ( InputStream in ) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; byte [ ] buf = new byte [ READ_BUFFER_LENGTH ] ; int read ; while ( ( read = in . read ( buf , 0 , READ_BUFFER_LENGTH ) ) != - 1 ) { outputStream . write ( buf , 0 , read ) ; } return outputStream . toByteArray ( ) ; }
target:  Reads all bytes from an InputStream and stores them in an array, up to a maximum count.