com.etymon.pjx.stream
Class PdfEncodeStream

java.lang.Object
  extended by com.etymon.pjx.stream.PdfEncodeStream

public class PdfEncodeStream
extends java.lang.Object

Provides commonly used stream encoding functions. This class is synchronized.


Field Summary
protected  java.util.Set _compressionFilters
          The set of stream filters used for compression.
protected  PdfFlateFilter _flateFilter
           
protected  PdfManager _m
          The manager associated with the PDF document.
protected static PdfName PDFNAME_CCITTFAXDECODE
           
protected static PdfName PDFNAME_DCTDECODE
           
protected static PdfName PDFNAME_FILTER
           
protected static PdfName PDFNAME_FLATEDECODE
           
protected static PdfName PDFNAME_JBIG2DECODE
           
protected static PdfName PDFNAME_LZWDECODE
           
protected static PdfName PDFNAME_RUNLENGTHDECODE
           
 
Constructor Summary
PdfEncodeStream(PdfManager manager)
          Constructs an instance of this class with a specified manager.
 
Method Summary
 PdfStream compressFlate(PdfStream stream)
          Encodes a stream using the Flate compression method (based on zlib/deflate).
 
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

PDFNAME_LZWDECODE

protected static final PdfName PDFNAME_LZWDECODE

PDFNAME_RUNLENGTHDECODE

protected static final PdfName PDFNAME_RUNLENGTHDECODE

PDFNAME_CCITTFAXDECODE

protected static final PdfName PDFNAME_CCITTFAXDECODE

PDFNAME_JBIG2DECODE

protected static final PdfName PDFNAME_JBIG2DECODE

PDFNAME_DCTDECODE

protected static final PdfName PDFNAME_DCTDECODE

_compressionFilters

protected java.util.Set _compressionFilters
The set of stream filters used for compression.


_flateFilter

protected PdfFlateFilter _flateFilter

_m

protected PdfManager _m
The manager associated with the PDF document.

Constructor Detail

PdfEncodeStream

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

Parameters:
manager - the manager instance.
Method Detail

compressFlate

public PdfStream compressFlate(PdfStream stream)
                        throws java.io.IOException,
                               PdfFormatException
Encodes a stream using the Flate compression method (based on zlib/deflate). If the stream is already compressed with the Flate, LZW, RunLength, CCITTFax, JBIG2, or DCT method, then this method returns the original stream unmodified. This method uses PdfFlateFilter.encode(PdfStream) to perform the encoding.

Parameters:
stream - the stream to encode.
Returns:
the encoded stream, or the original stream if it is already compressed.
Throws:
java.io.IOException
PdfFormatException