- java.lang.Object
-
- org.jfree.pdf.internal.PDFObject
-
- org.jfree.pdf.stream.Stream
-
- Direct Known Subclasses:
GraphicsStream
,PDFImage
,PDFSoftMaskImage
public abstract class Stream extends PDFObject
-
-
Constructor Summary
Constructors Constructor Description Stream(int number)
Creates a new stream.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFilter(Filter f)
Adds a filter to the stream.protected Dictionary
createDictionary(int streamLength)
Creates the dictionary for this stream object.byte[]
getObjectBytes()
Returns the PDF bytes for this stream object, with all current filters applied.abstract byte[]
getRawStreamData()
Returns the raw data for the stream.void
removeFilters()
Removes any filters that were previously added.-
Methods inherited from class org.jfree.pdf.internal.PDFObject
getGeneration, getNumber, getReference, toPDFBytes
-
-
-
-
Field Detail
-
filters
private final java.util.List<Filter> filters
Filters (if any) to apply to the stream data.
-
-
Method Detail
-
addFilter
public void addFilter(Filter f)
Adds a filter to the stream.- Parameters:
f
- the filter (null
not permitted).- See Also:
removeFilters()
-
removeFilters
public void removeFilters()
Removes any filters that were previously added.- See Also:
addFilter(org.jfree.pdf.filter.Filter)
-
getObjectBytes
public byte[] getObjectBytes() throws java.io.IOException
Returns the PDF bytes for this stream object, with all current filters applied.- Specified by:
getObjectBytes
in classPDFObject
- Returns:
- The PDF bytes for this stream object.
- Throws:
java.io.IOException
- if there is a problem writing to the byte array.
-
createDictionary
protected Dictionary createDictionary(int streamLength)
Creates the dictionary for this stream object. The dictionary will be populated with the stream length and the decode values for any filters that are currently applied.- Parameters:
streamLength
- the stream length.- Returns:
- The dictionary.
-
getRawStreamData
public abstract byte[] getRawStreamData()
Returns the raw data for the stream.- Returns:
- The raw data for the stream.
-
-