public class PdfStream extends PdfObject
Modifier and Type | Field and Description |
---|---|
protected java.nio.ByteBuffer |
_bb
The byte sequence contained by the stream.
|
protected PdfDictionary |
_d
The stream dictionary.
|
protected static PdfName |
PDFNAME_LENGTH
A
PdfName object representing the name
Length . |
Modifier | Constructor and Description |
---|---|
protected |
PdfStream()
A protected constructor intended to be called only from
wrap(PdfDictionary,
ByteByffer) . |
|
PdfStream(PdfDictionary d,
java.nio.ByteBuffer bb)
Constructs a stream object from a PDF dictionary and a
ByteBuffer . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this instance with another PDF object for equality.
|
java.nio.ByteBuffer |
getBuffer()
Returns the byte sequence contained in this stream.
|
PdfDictionary |
getDictionary()
Returns this stream's dictionary.
|
int |
hashCode()
Returns a hash code for this object.
|
protected static PdfStream |
wrap(PdfDictionary d,
java.nio.ByteBuffer bb)
A factory for fast construction of this class.
|
protected int |
writePdf(PdfWriter w,
boolean spacing)
Writes this object in PDF format.
|
clone, filter, filterContents, toString
protected java.nio.ByteBuffer _bb
protected PdfDictionary _d
protected static final PdfName PDFNAME_LENGTH
PdfName
object representing the name
Length
.protected PdfStream()
wrap(PdfDictionary,
ByteByffer)
.public PdfStream(PdfDictionary d, java.nio.ByteBuffer bb)
ByteBuffer
. The stream's byte sequence is
read from the ByteBuffer
starting at its
current position and ending at its limit.d
- the PDF dictionary.bb
- the ByteBuffer
.public java.nio.ByteBuffer getBuffer()
ByteBuffer
object is read-only.public PdfDictionary getDictionary()
protected static PdfStream wrap(PdfDictionary d, java.nio.ByteBuffer bb)
PdfDictionary
and ByteBuffer
.
The entire capacity of ByteBuffer
is assumed
to represent the stream's byte sequence. The Length value
in the stream dictionary is assumed to be correct. The
calling method must ensure that the ByteBuffer
is never externally modified or accessed, in order to meet
the immutability requirement of PdfObject
.m
- the PdfDictionary
and
ByteBuffer
to be used to back this stream.protected int writePdf(PdfWriter w, boolean spacing) throws java.io.IOException
PdfObject
writePdf
in class PdfObject
w
- the PdfWriter
to write to.spacing
- specifies whether to add white-space before
the object. A value of true
enables the
addition of white-space. If the object begins with a PDF
delimiter, then this option is ignored and no white-space
is written.java.io.IOException
public boolean equals(java.lang.Object obj)
PdfObject