|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.cos.COSDocumentElement
de.intarsys.pdf.cos.COSObject
de.intarsys.pdf.cos.COSCompositeObject
de.intarsys.pdf.cos.COSStream
public class COSStream
An object representing stream data in a PDF document. Unlike a string, stream data is not restricted in length. Stream data may be encoded with the filter implementation.
Field Summary | |
---|---|
static COSName |
DK_DecodeParms
|
static COSName |
DK_DP
|
static COSName |
DK_F
|
static COSName |
DK_FDecodeParams
|
static COSName |
DK_FFilter
|
static COSName |
DK_Filter
|
static COSName |
DK_Length
|
static COSName |
DK_Resources
|
static Object |
SLOT_BYTES
|
Fields inherited from class de.intarsys.pdf.cos.COSObject |
---|
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER |
Method Summary | |
---|---|
Object |
accept(ICOSObjectVisitor visitor)
Accept a visitor object. |
void |
addFilter(COSName name)
Add a new filter to this. |
void |
addObjectListener(ICOSObjectListener listener)
Add a listener for object changes. |
COSStream |
asStream()
|
Iterator |
basicIterator()
An iterator over contained objects and references. |
void |
basicSetDecodedBytes(byte[] newBytes)
Set the streams logical content. |
void |
basicSetEncodedBytes(byte[] newBytes)
Set the streams physical content. |
COSStream |
copyDecodeFirst()
A copy of this, bytes decoded. |
COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document. |
COSObject |
copyShallow()
Make a copy of the receiver. |
static COSStream |
create(COSDictionary dict)
Create a new COSStream . |
int |
getAnyLength()
The declared or real length for this. |
byte[] |
getDecodedBytes()
The unfiltered (logical) stream content. |
byte[] |
getDecodedBytesWritable()
The unfiltered content as in getDecodedBytes, but allow the caller to manipulate the result by copying/not caching the returned bytes |
COSObject |
getDecodeParams()
The options or an array of options for filtering. |
static COSObject |
getDecodeParams(COSDictionary dict)
The options or an array of options for filtering. |
static COSDictionary |
getDecodeParams(COSDictionary dict,
COSName name)
The options corresponding to the first occurence of the filter name . |
COSObject |
getDecodeParams(COSName name)
The options corresponding to the first occurence of the filter name . |
COSDictionary |
getDict()
The stream dictionary |
byte[] |
getEncodedBytes()
The filtered (physical) stream content. |
COSObject |
getFilters()
Return the filter or the collection of filters for the stream. |
static COSObject |
getFilters(COSDictionary dict)
Return the filter or the collection of filters for the stream. |
COSDictionary |
getFirstDecodeParam()
A dictionary with filter options or the first element of an array of such dictionaries for each filter. |
COSName |
getFirstFilter()
The filter or the first element of the collection of filters for the stream. |
int |
getLength()
The length of the filtered content |
static boolean |
hasFilter(COSDictionary dict,
COSName name)
true if the stream hs declared a filter name . |
boolean |
hasFilter(COSName name)
true if the stream hs declared a filter name . |
boolean |
isExternal()
true if the stream dictionary contains the F key. |
static boolean |
isExternal(COSDictionary dict)
true if the stream dictionary contains the F key. |
Iterator |
iterator()
An iterator over contained objects. |
void |
removeFilters()
Remove all filters from this. |
void |
removeObjectListener(ICOSObjectListener listener)
Remove a listener for object changes. |
void |
restoreState(Object object)
|
Object |
saveState()
|
void |
setDecodedBytes(byte[] newBytes)
Set the streams logical content |
void |
setEncodedBytes(byte[] newBytes)
Set the stream physical content. |
Methods inherited from class de.intarsys.pdf.cos.COSCompositeObject |
---|
associate, containable, copyDeep, disassociate, getAttribute, isObjectListenerAvailable, isPrimitive, referenceCount, referenceIndirect, register, removeAttribute, restoreStateContainer, saveStateContainer, setAttribute, willChange |
Methods inherited from class de.intarsys.pdf.cos.COSObject |
---|
asArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asString, beConstant, beIndirect, containable, copyOptional, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, isDangling, isIndirect, isNull, isNumber, isSwapped, stringValue, toString |
Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement |
---|
handleException, isReference |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.intarsys.pdf.cos.ICOSContainer |
---|
getDoc |
Field Detail |
---|
public static final Object SLOT_BYTES
public static final COSName DK_DecodeParms
public static final COSName DK_DP
public static final COSName DK_F
public static final COSName DK_FDecodeParams
public static final COSName DK_FFilter
public static final COSName DK_Filter
public static final COSName DK_Length
public static final COSName DK_Resources
Method Detail |
---|
public static COSStream create(COSDictionary dict)
COSStream
.
dict
- An optional dictionary to be used as the streams dictionary.
COSStream
.public static COSObject getDecodeParams(COSDictionary dict)
public static COSDictionary getDecodeParams(COSDictionary dict, COSName name)
name
.
name
.public static COSObject getFilters(COSDictionary dict)
public static boolean hasFilter(COSDictionary dict, COSName name)
true
if the stream hs declared a filter name
.
name
- The name of the filter.
true
if the stream hs declared a filter
name
.public static boolean isExternal(COSDictionary dict)
true
if the stream dictionary contains the F key.
true
if the stream dictionary contains the F key.public Object accept(ICOSObjectVisitor visitor) throws COSVisitorException
COSDocumentElement
visitor
by "double dispatching".
accept
in class COSDocumentElement
visitor
- The object visiting the receiver.
COSVisitorException
- An exception depending on the visitor semantics.public void addFilter(COSName name)
name
- The logical naem of the filter.public void addObjectListener(ICOSObjectListener listener)
COSObject
addObjectListener
in class COSCompositeObject
listener
- The listener to be informed about changes.public COSStream asStream()
asStream
in class COSObject
null
public Iterator basicIterator()
COSObject
This iterator returns COSDocumentElements, leaving references alone.
basicIterator
in class COSObject
public void basicSetDecodedBytes(byte[] newBytes)
newBytes
- the logical content for the streampublic void basicSetEncodedBytes(byte[] newBytes)
newBytes
- the physical content for the streampublic COSStream copyDecodeFirst() throws IOException
IOException
public COSObject copyDeep(Map copied)
COSObject
The copied
map is used to identify objects copied in
earlier runs of this method to avoid duplicating resources used in
different copy targets (for example the pages of a document).
copied
is modified while executing copyDeep
and contains a mapping from indirect objects in the original document to
copied objects.
The algorithm copies this
along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyDeep
in class COSCompositeObject
COSObject.copyDeep()
public COSObject copyShallow()
COSObject
A copy is made of the receiver and after this recursively of all not indirect objects.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyShallow
in class COSObject
public int getAnyLength()
public byte[] getDecodedBytes()
IOException
public byte[] getDecodedBytesWritable()
public COSObject getDecodeParams()
public COSObject getDecodeParams(COSName name)
name
.
name
.public COSDictionary getDict()
public byte[] getEncodedBytes()
public COSObject getFilters()
public COSDictionary getFirstDecodeParam()
public COSName getFirstFilter()
public int getLength()
public boolean hasFilter(COSName name)
true
if the stream hs declared a filter name
.
name
- The name of the filter.
true
if the stream hs declared a filter
name
.public boolean isExternal()
true
if the stream dictionary contains the F key.
true
if the stream dictionary contains the F key.public Iterator iterator()
COSObject
This iterator returns only COSObject instances, references are dereferenced.
iterator
in class COSObject
public void removeFilters()
public void removeObjectListener(ICOSObjectListener listener)
COSObject
removeObjectListener
in class COSCompositeObject
listener
- The listener to be removed.public void restoreState(Object object)
restoreState
in interface de.intarsys.tools.component.ISaveStateSupport
restoreState
in class COSObject
public Object saveState()
public void setDecodedBytes(byte[] newBytes)
newBytes
- The logical content for the streampublic void setEncodedBytes(byte[] newBytes)
newBytes
- the physical content for the stream
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |