return ByteBuffer.wrap(decode(dict, bytes));
}
protected static byte[] decode(PDFObject dict, byte[] source) throws IOException {
JBIG2Decoder decoder;
decoder = new JBIG2Decoder();
try {
byte[] globals = getOptionFieldBytes(dict, "JBIG2Globals");
if (globals != null) {
decoder.setGlobalData(globals);
}
decoder.decodeJBIG2(source);
} catch (JBIG2Exception ex) {
IOException ioException;
ioException = new IOException();
ioException.initCause(ex);
throw ioException;
}
return decoder.getPageAsJBIG2Bitmap(0).getData(true);
}