public static byte [ ] absorbInputStream ( InputStream input ) throws IOException { ByteArrayOutputStream output = null ; try { output = new ByteArrayOutputStream ( ) ; absorbInputStream ( input , output ) ; return output . toByteArray ( ) ; } finally { output . close ( ) ; } }
Reads all bytes from an input stream .