Code example for ByteArrayInputStream

0
    protected abstract OutputStream wrapOutputStream(OutputStream underlying) throws IOException;
 
    protected abstract InputStream wrapInputStream(InputStream underlying) throws IOException;
 
    public byte[] inflate(byte[] data) throws IOException {
        InputStream is = wrapInputStream(new ByteArrayInputStream(data));
        byte[] inflated = IOUtils.toByteArray(is);
        is.close();
        return inflated;
    } 
}