public abstract class AbstractPDFStream extends PDFObject
Modifier | Constructor and Description |
---|---|
protected |
AbstractPDFStream() |
protected |
AbstractPDFStream(boolean encodeOnTheFly) |
protected |
AbstractPDFStream(PDFDictionary dictionary) |
protected |
AbstractPDFStream(PDFDictionary dictionary,
boolean encodeOnTheFly) |
Modifier and Type | Method and Description |
---|---|
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.
|
Object |
get(String key) |
void |
getChildren(Set<PDFObject> children) |
protected String |
getDefaultFilterName()
Returns the name of a suitable filter for this PDF object.
|
protected PDFDictionary |
getDictionary() |
PDFFilterList |
getFilterList()
Returns the associated filter list.
|
protected abstract int |
getSizeHint()
Returns a value that hints at the size of the encoded stream.
|
protected boolean |
multipleFiltersAllowed()
Whether multiple filters can be applied.
|
int |
output(OutputStream stream)
Overload the base object method so we don't have to copy
byte arrays around so much
Write the PDF represention of this object
|
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).
|
void |
put(String key,
Object value)
Puts the given object in the dictionary associated to this stream.
|
void |
registerChildren() |
void |
setDocument(PDFDocument doc)
Sets the parent PDFDocument.
|
protected void |
setupFilterList()
Sets up the default filters for this stream if they haven't been set
from outside.
|
boolean |
supportsObjectStream() |
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
protected AbstractPDFStream()
protected AbstractPDFStream(PDFDictionary dictionary)
protected AbstractPDFStream(boolean encodeOnTheFly)
protected AbstractPDFStream(PDFDictionary dictionary, boolean encodeOnTheFly)
protected final PDFDictionary getDictionary()
public void put(String key, Object value)
key
- the key in the dictionaryvalue
- the value to storeprotected void setupFilterList()
protected String getDefaultFilterName()
PDFFilterList
public PDFFilterList getFilterList()
protected abstract int getSizeHint() throws IOException
IOException
- in case of an I/O problemprotected abstract void outputRawStreamData(OutputStream out) throws IOException
out
- OutputStream to write toIOException
- In case of an I/O problemprotected int outputStreamData(StreamCache encodedStream, OutputStream out) throws IOException
encodedStream
- already encoded/filtered stream to writeout
- OutputStream to write toIOException
- in case of an I/O problemprotected StreamCache encodeStream() throws IOException
IOException
- in case of an I/O problemprotected int encodeAndWriteStream(OutputStream out, PDFNumber refLength) throws IOException
out
- OutputStream to write torefLength
- PDFNumber object to receive the stream lengthIOException
- in case of an I/O problempublic int output(OutputStream stream) throws IOException
output
in class PDFObject
stream
- the stream to write the PDF toIOException
- if there is an error writing to the streampublic void setDocument(PDFDocument doc)
PDFObject
setDocument
in class PDFObject
doc
- the PDFDocument.protected void populateStreamDict(Object lengthEntry)
lengthEntry
- value for the /Length entryprotected void prepareImplicitFilters()
protected boolean multipleFiltersAllowed()
public void getChildren(Set<PDFObject> children)
getChildren
in class PDFObject
public void registerChildren()
public boolean supportsObjectStream()
supportsObjectStream
in class PDFObject
Copyright © 2025 Apache Software Foundation. All rights reserved.