org.apache.fop.pdf
Class PDFStream
java.lang.Object
|
+--org.apache.fop.pdf.PDFObject
|
+--org.apache.fop.pdf.AbstractPDFStream
|
+--org.apache.fop.pdf.PDFStream
- Direct Known 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.
Constructor Summary |
PDFStream()
Create an empty stream object |
Method Summary |
void |
add(java.lang.String s)
Append data to the stream |
int |
getDataLength()
Returns the size of the content. |
protected int |
getSizeHint()
Returns a value that hints at the size of the encoded stream. |
protected int |
output(java.io.OutputStream stream)
Overload the base object method so we don't have to copy
byte arrays around so much |
protected void |
outputRawStreamData(java.io.OutputStream out)
Sends the raw stream data to the target OutputStream. |
void |
setData(byte[] data)
Used to set the contents of the PDF stream. |
Methods inherited from class org.apache.fop.pdf.PDFObject |
encode, encodeString, encodeText, formatDateTime, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, referencePDF, setDocument, setObjectNumber, toPDF, toPDFString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
data
protected StreamCache data
- The stream of PDF commands
PDFStream
public PDFStream()
- Create an empty stream object
add
public void add(java.lang.String s)
- Append data to the stream
- Parameters:
s
- the string of PDF to add
setData
public void setData(byte[] data)
throws java.io.IOException
- Used to set the contents of the PDF stream.
- Parameters:
data
- the contents as a byte array- Throws:
java.io.IOException
- in case of an I/O problem
getDataLength
public int getDataLength()
- Returns the size of the content.
- Returns:
- size of the content
getSizeHint
protected int getSizeHint()
throws java.io.IOException
- Description copied from class:
AbstractPDFStream
- 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.
- Overrides:
getSizeHint
in class AbstractPDFStream
- See Also:
AbstractPDFStream.getSizeHint()
outputRawStreamData
protected void outputRawStreamData(java.io.OutputStream out)
throws java.io.IOException
- Description copied from class:
AbstractPDFStream
- Sends the raw stream data to the target OutputStream.
- Overrides:
outputRawStreamData
in class AbstractPDFStream
- See Also:
AbstractPDFStream.outputRawStreamData(OutputStream)
output
protected int output(java.io.OutputStream stream)
throws java.io.IOException
- Description copied from class:
AbstractPDFStream
- Overload the base object method so we don't have to copy
byte arrays around so much
- Overrides:
output
in class AbstractPDFStream
- See Also:
PDFObject.output(OutputStream)
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.