public class PjStream extends PjObject
Modifier and Type | Field and Description |
---|---|
protected PjStreamDictionary |
_d |
protected byte[] |
_s |
Constructor and Description |
---|
PjStream(byte[] s)
Creates a stream as a wrapper around a byte array.
|
PjStream(PjStreamDictionary d,
byte[] s)
Creates a stream as a wrapper around a PjStreamDictionary and
byte array.
|
Modifier and Type | Method and Description |
---|---|
PjStream |
ascii85Decode()
Decode this stream if it is compressed with the Ascii85
algorithm.
|
static byte[] |
ascii85Decode(byte[] src) |
static byte[] |
ascii85Encode(byte[] src) |
(package private) static char[] |
ascii85EncodeWord(long word) |
(package private) static long |
bytesToLong(byte[] b,
int offset,
int len) |
java.lang.Object |
clone()
Returns a deep copy of this object.
|
PjStream |
flateCompress()
Compress this stream with the Flate algorithm if it is not
already compressed.
|
PjStream |
flateDecompress()
Decompresses this stream if it is compressed with the Flate
algorithm.
|
byte[] |
getBuffer()
Returns the byte array used in the representation of this
stream.
|
PjStreamDictionary |
getStreamDictionary()
Returns the PjStreamDictionary used in the representation of this
stream.
|
void |
renumber(java.util.Hashtable map)
Renumbers object references within this object.
|
void |
setLength()
Sets the Length field in the stream dictionary to
accurately reflect the length of the stream.
|
(package private) static long |
toWord(byte[] b,
int offset,
int sigDigits) |
long |
writePdf(java.io.OutputStream os)
Writes this PDF stream to a stream in PDF format.
|
protected PjStreamDictionary _d
protected byte[] _s
public PjStream(byte[] s)
s
- the byte array to use for this stream.public PjStream(PjStreamDictionary d, byte[] s)
d
- the dictionary to use for this stream.s
- the byte array to use for this stream.public PjStreamDictionary getStreamDictionary()
public byte[] getBuffer()
public PjStream flateDecompress() throws InvalidPdfObjectException
InvalidPdfObjectException
- if an invalid object
type is encountered.public PjStream flateCompress() throws InvalidPdfObjectException
InvalidPdfObjectException
- if an invalid object
type is encountered.public void setLength()
public long writePdf(java.io.OutputStream os) throws java.io.IOException
writePdf
in class BaseObject
os
- the stream to write to.java.io.IOException
- if an I/O error occurs.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class BaseObject
java.lang.CloneNotSupportedException
- if the instance can not be cloned.public void renumber(java.util.Hashtable map)
public PjStream ascii85Decode() throws InvalidPdfObjectException
InvalidPdfObjectException
- if an invalid object
type is encountered.static long bytesToLong(byte[] b, int offset, int len)
static char[] ascii85EncodeWord(long word)
public static byte[] ascii85Encode(byte[] src)
static long toWord(byte[] b, int offset, int sigDigits)
public static byte[] ascii85Decode(byte[] src)