Package com.orsonpdf
Class Stream
java.lang.Object
com.orsonpdf.PDFObject
com.orsonpdf.Stream
- Direct Known Subclasses:
GraphicsStream
,PDFImage
,PDFSoftMaskImage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a filter to the stream.protected Dictionary
createDictionary
(int streamLength) Creates the dictionary for this stream object.byte[]
Returns the PDF bytes for this stream object, with all current filters applied.abstract byte[]
Returns the raw data for the stream.void
Removes any filters that were previously added.Methods inherited from class com.orsonpdf.PDFObject
getGeneration, getNumber, getReference, toPDFBytes
-
Field Details
-
filters
Filters (if any) to apply to the stream data.
-
-
Constructor Details
-
Stream
Stream(int number) Creates a new stream.- Parameters:
number
- the PDF object number.
-
-
Method Details
-
addFilter
Adds a filter to the stream.- Parameters:
f
- the filter (null
not permitted).- See Also:
-
removeFilters
public void removeFilters()Removes any filters that were previously added.- See Also:
-
getObjectBytes
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:
IOException
- if there is a problem writing to the byte array.
-
createDictionary
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.
-