public class PDFStream extends PDFObject
PDFObject and its subclasses allow direct access and manipulation of these simple objects. Some subclasses represent single data elements (e.g. PDFInteger represents a single integer value); other subclasses represent a collection of PDFObjects (e.g. PDFArray is an indexed array of data elements).
A PDFStream represents a stream of unsigned bytes, and may be inserted into any collection object. It includes a dictionary that describes how the data in the stream is encoded and other useful information about the stream. A PDFStream is always an indirect object.
PDFStreams can be encoded using built-in filters. These filters include compression schemes for most popular image formats, and text encoding translators to permit safe transmission of the document over the Internet. The data in a PDFStream will be automatically encoded when it is created; the user can read either the encoded (raw) or decoded (filtered) data.
PDFStreams can be used for any large collection of data that need not be read into memory all at once, including image data, multimedia data or XML markup.
| Constructor and Description |
|---|
PDFStream(java.io.InputStream stream,
Document doc,
PDFDict encoding_dict,
PDFArray encoding_params)
General constructor
|
PDFStream(java.io.InputStream stream,
PDFObject docFromObj,
PDFDict encoding_dict,
PDFArray encoding_params)
General constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
PDFDict |
getDict()
The encoding dictionary for the stream.
|
java.io.InputStream |
getFilteredStream()
The stream data of this object, decoded according to the filter data
in its dictionary.
|
int |
getLength()
The encoded length of the stream.
|
java.io.InputStream |
getStream(PDFStreamOpenMode mode)
The stream data of this object, processed according to the mode
|
int |
getStreamPos()
The byte offset of this stream in the PDF file.
|
java.io.InputStream |
getUnfilteredStream()
The unfiltered data of this stream object.
|
void |
SetData(java.io.InputStream stream,
PDFDict encoding_dict,
PDFArray encoding_params)
Replace the data in this PDFStream
|
java.lang.String |
toString() |
clone, clone, clone, clone, clone, compareTo, destroy, enumPDFObjects, equals, getDocument, getGeneration, getID, getIndirect, getPDFHashValuepublic PDFStream(java.io.InputStream stream,
Document doc,
PDFDict encoding_dict,
PDFArray encoding_params)
stream - java.io.InputStream which will provide data for this PDFStreamdoc - Document object containing this PDFStreamencoding_dict - PDFDict describing properties of this stream, including the encodingencoding_params - PDFArray describing parameters for encoding this streampublic PDFStream(java.io.InputStream stream,
PDFObject docFromObj,
PDFDict encoding_dict,
PDFArray encoding_params)
stream - java.io.InputStream which will provide data for this PDFStreamdocFromObj - The new PDFArray will be created in the same document as this object.encoding_dict - PDFDict describing properties of this stream, including the encodingencoding_params - PDFArray describing parameters for encoding this streampublic java.io.InputStream getStream(PDFStreamOpenMode mode)
mode - the open mode with which to read this streampublic java.io.InputStream getFilteredStream()
public java.io.InputStream getUnfilteredStream()
public void SetData(java.io.InputStream stream,
PDFDict encoding_dict,
PDFArray encoding_params)
stream - java.io.InputStream which will provide data for this PDFStreamencoding_dict - PDFDict describing properties of this stream, including the encodingencoding_params - PDFArray describing parameters for encoding this streampublic PDFDict getDict()
public int getLength()
public int getStreamPos()