question: public static byte [ ] toByteArray ( InputStream input ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; stream ( input , output ) ; return output . toByteArray ( ) ; }
target:  Read the given input stream into a byte array. The given input stream will implicitly be closed after streaming, regardless of whether an exception is been thrown or not.