public static byte[] readBytes(InputStream is) throws IOException {
        if (is == null) {
            return null;
        }
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        copyStream(is, baos);
        return baos.toByteArray();
    }
public static byte [ ] readBytes ( InputStream is ) throws IOException { if ( is == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; copyStream ( is , baos ) ; return baos . toByteArray ( ) ; }
Read an <code>InputStream</code> into <code>byte[]</code> until EOF.
<br>
Does not close the InputStream!

@param is the stream to read the bytes from
@return all read bytes as an array
@throws IOException when read or write operation fails