com.sun.pdfview.decode

## Class PDFDecoder

- java.lang.Object
- - com.sun.pdfview.decode.PDFDecoder

    public class PDFDecoder
    extends java.lang.Object

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

Fields
`static java.util.Set<java.lang.String>` `DCT_FILTERS`

### Method Summary

Methods
`static java.nio.ByteBuffer` `decodeStream(PDFObject dict, java.nio.ByteBuffer streamBuf, java.util.Set<java.lang.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, java.util.Set<java.lang.String> filters)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DCT_FILTERS

    public static final java.util.Set<java.lang.String> DCT_FILTERS

### Method Detail

#### isLastFilter

    public static boolean isLastFilter(PDFObject dict,
                       java.util.Set<java.lang.String> filters)
                                throws java.io.IOException

Throws:
  `java.io.IOException`

#### decodeStream

    public static java.nio.ByteBuffer decodeStream(PDFObject dict,
                                   java.nio.ByteBuffer streamBuf,
                                   java.util.Set<java.lang.String> filterLimits)
                                            throws java.io.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 stream
  `streamBuf` - the data in the stream, as a byte buffer
Throws:
  `java.io.IOException`

#### isEncrypted

    public static boolean isEncrypted(PDFObject dict)
                               throws java.io.IOException

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:
  `java.io.IOException` - if the stream dictionary can't be read