public class XrefTrailerResolver extends Object
#nextXrefObj(int)
must be called with start byte position. All following calls to
#setXRef(COSObjectKey, int)
or setTrailer(COSDictionary)
will add the data for this byte position.
After all objects are parsed the startxref position must be provided
using #setStartxref(int)
. This is used to build the chain of
active xref/trailer objects used for creating document trailer and xref table.Constructor and Description |
---|
XrefTrailerResolver() |
Modifier and Type | Method and Description |
---|---|
Set<Long> |
getContainedObjectNumbers(int objstmObjNr)
Returns object numbers which are referenced as contained
in object stream with specified object number.
|
COSDictionary |
getCurrentTrailer()
Returns the trailer last set by
setTrailer(COSDictionary) . |
COSDictionary |
getFirstTrailer() |
COSDictionary |
getLastTrailer() |
COSDictionary |
getTrailer()
Gets the resolved trailer.
|
Map<COSObjectKey,Long> |
getXrefTable()
Gets the resolved xref table.
|
void |
nextXrefObj(long startBytePos)
Signals that a new XRef object (table or stream) starts.
|
void |
setStartxref(long startxrefBytePosValue)
Sets the byte position of the first XRef
(has to be called after very last startxref was read).
|
void |
setTrailer(COSDictionary trailer)
Adds trailer information for current XRef object.
|
void |
setXRef(COSObjectKey objKey,
long offset)
Populate XRef HashMap of current XRef object.
|
public final COSDictionary getFirstTrailer()
public final COSDictionary getLastTrailer()
public void nextXrefObj(long startBytePos)
startBytePos
- the offset to start atpublic void setXRef(COSObjectKey objKey, long offset)
objKey
- The objkey, with id and gen numbersoffset
- The byte offset in this filepublic void setTrailer(COSDictionary trailer)
trailer
- the current document trailer dictionarypublic COSDictionary getCurrentTrailer()
setTrailer(COSDictionary)
.public void setStartxref(long startxrefBytePosValue)
startxrefBytePosValue
- starting position of the first XRefpublic COSDictionary getTrailer()
null
in case
#setStartxref(int)
was not called before.public Map<COSObjectKey,Long> getXrefTable()
null
in case
#setStartxref(int)
was not called before.public Set<Long> getContainedObjectNumbers(int objstmObjNr)
objstmObjNr
- object number of object stream for which contained object numbers
should be returnednull
if setStartxref(long)
was not
called before so that no resolved xref table existsCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.