org.apache.fop.pdf

Class PDFStream

Implemented Interfaces:
PDFWritable
Known Direct Subclasses:
PDFCMap, PDFICCStream, PDFMetadata, PDFTTFStream

public class PDFStream
extends AbstractPDFStream

Class representing a PDF stream.

A derivative of the PDF Object, a PDF Stream has not only a dictionary but a stream of PDF commands. The stream of commands is where the real work is done, the dictionary just provides information like the stream length.

Field Summary

protected StreamCache
data
The stream of PDF commands

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFStream()
Create an empty stream object

Method Summary

void
add(String s)
Append data to the stream
int
getDataLength()
Returns the size of the content.
protected int
getSizeHint()
protected int
output(OutputStream stream)
protected void
outputRawStreamData(OutputStream out)
void
setData(byte[] data)
Used to set the contents of the PDF stream.

Methods inherited from class org.apache.fop.pdf.AbstractPDFStream

buildStreamDict, encodeAndWriteStream, encodeStream, getFilterList, getSizeHint, output, outputRawStreamData, outputStreamData, prepareImplicitFilters, setupFilterList

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeString, encodeText, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, makeReference, output, referencePDF, setDocument, setObjectNumber, toInlinePDFString, toPDF, toPDFString

Field Details

data

protected StreamCache data
The stream of PDF commands

Constructor Details

PDFStream

public PDFStream()
Create an empty stream object

Method Details

add

public void add(String s)
Append data to the stream
Parameters:
s - the string of PDF to add

getDataLength

public int getDataLength()
Returns the size of the content.
Returns:
size of the content

getSizeHint

protected int getSizeHint()
            throws IOException
Overrides:
getSizeHint in interface AbstractPDFStream

output

protected int output(OutputStream stream)
            throws IOException
Overrides:
output in interface AbstractPDFStream

outputRawStreamData

protected void outputRawStreamData(OutputStream out)
            throws IOException
Overrides:
outputRawStreamData in interface AbstractPDFStream

setData

public void setData(byte[] data)
            throws IOException
Used to set the contents of the PDF stream.
Parameters:
data - the contents as a byte array

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.