public static byte [ ] streamBytes ( InputStream stream ) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; copyStream ( stream , bytes ) ; return bytes . toByteArray ( ) ; }
Get the stream bytes