Package org.apache.pdfbox.pdfparser
Class PDFXRefStream
java.lang.Object
org.apache.pdfbox.pdfparser.PDFXRefStream
- All Implemented Interfaces:
PDFXRef
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA class representing a free reference.(package private) static classA class representing a normal reference.(package private) static classA class representing an object stream reference. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate longprivate final COSStream -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.PDFXRefStream(COSDocument cosDocument) Create a fresh XRef stream like for a fresh file or an incremental update. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(COSWriterXRefEntry entry) Add an new entry to the XRef stream.voidaddTrailerInfo(COSDictionary trailerDict) Copy all Trailer Information to this file.getObject(int objectNumber) Returns the object referenced by the given object number.Returns the stream of the XRef.private int[]determines the minimal length required for all the lengths.voidsetSize(long streamSize) Set the size of the XRef stream.private voidwriteNumber(OutputStream os, long number, int bytes) private voidwriteStreamData(OutputStream os, int[] w)
-
Field Details
-
ENTRY_OBJSTREAM
private static final int ENTRY_OBJSTREAM- See Also:
-
ENTRY_NORMAL
private static final int ENTRY_NORMAL- See Also:
-
ENTRY_FREE
private static final int ENTRY_FREE- See Also:
-
streamData
-
objectNumbers
-
stream
-
size
private long size
-
-
Constructor Details
-
PDFXRefStream
Deprecated.Create a fresh XRef stream like for a fresh file or an incremental update. -
PDFXRefStream
Create a fresh XRef stream like for a fresh file or an incremental update.- Parameters:
cosDocument-
-
-
Method Details
-
getStream
Returns the stream of the XRef.- Returns:
- the XRef stream
- Throws:
IOException- if something went wrong
-
addTrailerInfo
Copy all Trailer Information to this file.- Parameters:
trailerDict- dictionary to be added as trailer info
-
addEntry
Add an new entry to the XRef stream.- Parameters:
entry- new entry to be added
-
getWEntry
private int[] getWEntry()determines the minimal length required for all the lengths.- Returns:
- the length information
-
setSize
public void setSize(long streamSize) Set the size of the XRef stream.- Parameters:
streamSize- size to bet set as stream size
-
getIndexEntry
-
writeNumber
- Throws:
IOException
-
writeStreamData
- Throws:
IOException
-
getObject
Returns the object referenced by the given object number.
-
PDFXRefStream(org.apache.pdfbox.cos.COSDocument)