Class PDFStream
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 Summary
ConstructorsConstructorDescriptionPDFStream(InputStream stream, Document doc, PDFDict encoding_dict, PDFArray encoding_params) General constructorPDFStream(InputStream stream, PDFObject docFromObj, PDFDict encoding_dict, PDFArray encoding_params) General constructor -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()getDict()The encoding dictionary for the stream.The stream data of this object, decoded according to the filter data in its dictionary.intThe encoded length of the stream.getStream(PDFStreamOpenMode mode) The stream data of this object, processed according to the modeintThe byte offset of this stream in the PDF file.The unfiltered data of this stream object.voidSetData(InputStream stream, PDFDict encoding_dict, PDFArray encoding_params) Replace the data in this PDFStreamtoString()Methods inherited from class com.datalogics.PDFL.PDFObject
clone, clone, clone, clone, clone, compareTo, destroy, enumPDFObjects, equals, getDocument, getGeneration, getID, getIndirect, getPDFHashValue
-
Constructor Details
-
PDFStream
General constructor- Parameters:
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 stream
-
PDFStream
public PDFStream(InputStream stream, PDFObject docFromObj, PDFDict encoding_dict, PDFArray encoding_params) General constructor- Parameters:
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 stream
-
-
Method Details
-
delete
public void delete() -
getStream
The stream data of this object, processed according to the mode- Parameters:
mode- the open mode with which to read this stream
-
getFilteredStream
The stream data of this object, decoded according to the filter data in its dictionary. -
getUnfilteredStream
The unfiltered data of this stream object. -
SetData
Replace the data in this PDFStream- Parameters:
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 stream
-
toString
-
getDict
The encoding dictionary for the stream. This includes all required information for decoding the stream. -
getLength
public int getLength()The encoded length of the stream. -
getStreamPos
public int getStreamPos()The byte offset of this stream in the PDF file.
-