org.apache.fop.pdf
Class AbstractPDFStream
- PDFWritable
public abstract class AbstractPDFStream
This is an abstract base class for PDF streams.
protected int | encodeAndWriteStream(OutputStream out, PDFNumber refLength) - Encodes and writes a stream directly to an OutputStream.
|
protected StreamCache | encodeStream() - Encodes the raw data stream for output to a PDF file.
|
PDFFilterList | getFilterList() - Returns the associated filter list.
|
protected abstract int | getSizeHint() - Returns a value that hints at the size of the encoded stream.
|
protected int | output(OutputStream stream) - Overload the base object method so we don't have to copy
byte arrays around so much
|
protected abstract void | outputRawStreamData(OutputStream out) - Sends the raw stream data to the target OutputStream.
|
protected int | outputStreamData(StreamCache encodedStream, OutputStream out) - Output just the stream data enclosed by stream/endstream markers
|
protected void | populateStreamDict(Object lengthEntry) - Populates the dictionary with all necessary entries for the stream.
|
protected void | prepareImplicitFilters() - Prepares implicit filters (such as the DCTFilter for JPEG images).
|
protected void | setupFilterList() - Sets up the default filters for this stream if they haven't been set
from outside.
|
encode , encodeBinaryToHexString , encodeString , encodeText , formatDateTime , formatDateTime , formatObject , getDocument , getDocumentSafely , getGeneration , getObjectID , getObjectNumber , getParent , hasObjectNumber , makeReference , output , outputInline , referencePDF , setDocument , setObjectNumber , setParent , toPDF , toPDFString |
AbstractPDFStream
public AbstractPDFStream()
Constructor for AbstractPDFStream.
encodeAndWriteStream
protected int encodeAndWriteStream(OutputStream out,
PDFNumber refLength)
throws IOException
Encodes and writes a stream directly to an OutputStream. The length of
the stream, in this case, is set on a PDFNumber object that has to be
prepared beforehand.
out
- OutputStream to write torefLength
- PDFNumber object to receive the stream length
- number of bytes written (header and trailer included)
encodeStream
protected StreamCache encodeStream()
throws IOException
Encodes the raw data stream for output to a PDF file.
getFilterList
public PDFFilterList getFilterList()
Returns the associated filter list.
getSizeHint
protected abstract int getSizeHint()
throws IOException
Returns a value that hints at the size of the encoded stream. This is
used to optimize buffer allocation so fewer buffer reallocations are
necessary.
- an estimated size (0 if no hint can be given)
output
protected int output(OutputStream stream)
throws IOException
Overload the base object method so we don't have to copy
byte arrays around so much
- output in interface PDFDictionary
outputRawStreamData
protected abstract void outputRawStreamData(OutputStream out)
throws IOException
Sends the raw stream data to the target OutputStream.
out
- OutputStream to write to
outputStreamData
protected int outputStreamData(StreamCache encodedStream,
OutputStream out)
throws IOException
Output just the stream data enclosed by stream/endstream markers
encodedStream
- already encoded/filtered stream to writeout
- OutputStream to write to
- int number of bytes written
populateStreamDict
protected void populateStreamDict(Object lengthEntry)
Populates the dictionary with all necessary entries for the stream.
Override this method if you need additional entries.
lengthEntry
- value for the /Length entry
prepareImplicitFilters
protected void prepareImplicitFilters()
Prepares implicit filters (such as the DCTFilter for JPEG images). You
must make sure that the appropriate filters are in the filter list at
the right places.
setupFilterList
protected void setupFilterList()
Sets up the default filters for this stream if they haven't been set
from outside.
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.