public class PdfStream extends PdfDictionary
PdfStream is the Pdf stream object.
A stream, like a string, is a sequence of characters. However, an application can
read a small portion of a stream at a time, while a string must be read in its entirety.
For this reason, objects with potentially large amounts of data, such as images and
page descriptions, are represented as streams.
A stream consists of a dictionary that describes a sequence of characters, followed by
the keyword stream, followed by zero or more lines of characters, followed by
the keyword endstream.
All streams must be PdfIndirectObjects. The stream dictionary must be a direct
object. The keyword stream that follows the stream dictionary should be followed by
a carriage return and linefeed or just a linefeed.
Remark: In this version only the FLATEDECODE-filter is supported.
This object is described in the 'Portable Document Format Reference Manual version 1.7'
section 3.2.7 (page 60-63).
PdfObject,
PdfDictionary| Modifier and Type | Field and Description |
|---|---|
static int |
BEST_COMPRESSION
A possible compression level.
|
protected boolean |
compressed
is the stream compressed?
|
protected int |
compressionLevel
The level of compression.
|
static int |
DEFAULT_COMPRESSION
A possible compression level.
|
protected InputStream |
inputStream |
protected int |
inputStreamLength |
static int |
NO_COMPRESSION
A possible compression level.
|
protected int |
rawLength |
protected ByteArrayOutputStream |
streamBytes |
hashMap| Modifier | Constructor and Description |
|---|---|
protected |
PdfStream()
Constructs a
PdfStream-object. |
|
PdfStream(byte[] bytes)
Constructs a
PdfStream-object. |
| Modifier and Type | Method and Description |
|---|---|
int |
getRawLength()
Gets the raw length of the stream.
|
protected void |
superToPdf(PdfWriter writer,
OutputStream os) |
void |
toPdf(PdfWriter writer,
OutputStream os)
Writes the PDF representation of this
PdfDictionary as an
array of byte to the given OutputStream. |
String |
toString()
Returns a string representation of this
PdfDictionary. |
get, getAsArray, getAsDict, getAsName, getAsNumber, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, put, remove, sizegetBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, typepublic static final int DEFAULT_COMPRESSION
public static final int NO_COMPRESSION
public static final int BEST_COMPRESSION
protected boolean compressed
protected int compressionLevel
protected ByteArrayOutputStream streamBytes
protected InputStream inputStream
protected int inputStreamLength
protected int rawLength
public PdfStream(byte[] bytes)
PdfStream-object.bytes - content of the new PdfObject as an array of byte.protected PdfStream()
PdfStream-object.public int getRawLength()
protected void superToPdf(PdfWriter writer, OutputStream os) throws IOException
IOExceptionpublic void toPdf(PdfWriter writer, OutputStream os) throws IOException
PdfDictionaryPdfDictionary as an
array of byte to the given OutputStream.toPdf in class PdfDictionarywriter - for backwards compatibilityos - the OutputStream to write the bytes to.IOException - Exception with a I/O errorPdfDictionary.toPdf(com.aowagie.text.pdf.PdfWriter, java.io.OutputStream)public String toString()
PdfDictionaryPdfDictionary.
The string doesn't contain any of the content of this dictionary.
Rather the string "dictionary" is returned, possibly followed by the
type of this PdfDictionary, if set.toString in class PdfDictionaryPdfDictionaryPdfObject.toString()Copyright © 2021. All rights reserved.