com.etymon.pjx.stream
Class PdfFlateFilter

java.lang.Object
  extended by com.etymon.pjx.stream.PdfFlateFilter
All Implemented Interfaces:
PdfStreamFilter

public class PdfFlateFilter
extends java.lang.Object
implements PdfStreamFilter

Implements a stream filter for Flate compression (based on zlib/deflate). This class is synchronized.


Field Summary
protected  byte[] _ba
          A byte array used for buffering.
(package private)  java.util.zip.Deflater _deflater
          Instance used for deflating.
(package private)  java.util.zip.Inflater _inflater
          Instance used for inflating.
protected  PdfManager _m
          The manager associated with the PDF document.
protected static PdfName PDFNAME_FILTER
           
protected static PdfName PDFNAME_FLATEDECODE
           
 
Constructor Summary
PdfFlateFilter(PdfManager manager)
          Constructs an instance of this class with a specified manager instance.
 
Method Summary
 PdfStream decode(PdfStream stream)
          Decodes a stream using this filter's decoding method.
 PdfStream encode(PdfStream stream)
          Encodes a stream using this filter's encoding method.
 PdfName getName()
          Returns the name of this filter method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDFNAME_FILTER

protected static final PdfName PDFNAME_FILTER

PDFNAME_FLATEDECODE

protected static final PdfName PDFNAME_FLATEDECODE

_m

protected PdfManager _m
The manager associated with the PDF document.


_ba

protected byte[] _ba
A byte array used for buffering.


_deflater

java.util.zip.Deflater _deflater
Instance used for deflating.


_inflater

java.util.zip.Inflater _inflater
Instance used for inflating.

Constructor Detail

PdfFlateFilter

public PdfFlateFilter(PdfManager manager)
Constructs an instance of this class with a specified manager instance.

Parameters:
manager - the manager instance.
Method Detail

getName

public PdfName getName()
Description copied from interface: PdfStreamFilter
Returns the name of this filter method. This is the name to be used in the stream dictionary.

Specified by:
getName in interface PdfStreamFilter

encode

public PdfStream encode(PdfStream stream)
                 throws java.io.IOException,
                        PdfFormatException
Description copied from interface: PdfStreamFilter
Encodes a stream using this filter's encoding method.

Specified by:
encode in interface PdfStreamFilter
Parameters:
stream - the stream to encode.
Returns:
the encoded stream.
Throws:
PdfFormatException
java.io.IOException

decode

public PdfStream decode(PdfStream stream)
                 throws java.io.IOException,
                        PdfFormatException,
                        PdfDecoderFormatException
Description copied from interface: PdfStreamFilter
Decodes a stream using this filter's decoding method.

Specified by:
decode in interface PdfStreamFilter
Parameters:
stream - the stream to decode.
Returns:
the decoded stream.
Throws:
PdfFormatException
java.io.IOException
PdfDecoderFormatException