|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.etymon.pj.object.BaseObject
com.etymon.pj.object.PjObject
com.etymon.pj.object.PjStream
public class PjStream
A representation of the PDF stream type.
Field Summary | |
---|---|
protected PjStreamDictionary |
_d
|
protected byte[] |
_s
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.etymon.pj.object.BaseObject |
---|
toString, write, write, write, writeln |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PjStreamDictionary _d
protected byte[] _s
Constructor Detail |
---|
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.Method Detail |
---|
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)
renumber
in class PjObject
map
- the table of object number mappings. Each
object number is looked up by key in the hash table, and
the associated value is assigned as the new object number.
The map hash table should consist of PjNumber keys and
PjReference values.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |