Package org.loboevolution.pdfview.decode
Class PDFDecoder
java.lang.Object
org.loboevolution.pdfview.decode.PDFDecoder
A PDF Decoder encapsulates all the methods of decoding a stream of bytes
based on all the various encoding methods.
You should use the decodeStream() method of this object rather than using any of the decoders directly.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBuffer
decodeStream
(PDFObject dict, ByteBuffer streamBuf, Set<String> filterLimits) decode a byte[] stream using the filters specified in the object's dictionary (passed as argument 1).static boolean
isEncrypted
(PDFObject dict) Determines whether a stream is encrypted or not; note that encodings (e.g., Flate, LZW) are not considered encryptions.static boolean
isLastFilter
(PDFObject dict, Set<String> filters) isLastFilter.
-
Field Details
-
DCT_FILTERS
ConstantDCT_FILTERS
-
-
Method Details
-
isLastFilter
isLastFilter.
- Parameters:
dict
- aPDFObject
object.filters
- aSet
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
decodeStream
public static ByteBuffer decodeStream(PDFObject dict, ByteBuffer streamBuf, Set<String> filterLimits) throws IOException decode a byte[] stream using the filters specified in the object's dictionary (passed as argument 1).- Parameters:
dict
- the dictionary associated with the streamstreamBuf
- the data in the stream, as a byte bufferfilterLimits
- aSet
object.- Returns:
- a
ByteBuffer
object. - Throws:
IOException
- if any.
-
isEncrypted
Determines whether a stream is encrypted or not; note that encodings (e.g., Flate, LZW) are not considered encryptions.- Parameters:
dict
- the stream dictionary- Returns:
- whether the stream is encrypted
- Throws:
IOException
- if any.
-