org.apache.pdfbox.pdfparser
Class PDFXRefStream

java.lang.Object
  extended by org.apache.pdfbox.pdfparser.PDFXRefStream
All Implemented Interfaces:
PDFXRef

public class PDFXRefStream
extends java.lang.Object
implements PDFXRef

Version:
$Revision: $
Author:
Alexander Funk

Constructor Summary
PDFXRefStream()
          Create a fresh XRef stream like for a fresh file or an incremental update.
 
Method Summary
 void addEntry(COSWriterXRefEntry entry)
          Add an new entry to the XRef stream.
 void addTrailerInfo(COSDictionary trailerDict)
          Copy all Trailer Information to this file.
 COSObject getObject(int objectNumber)
          Returns the object referenced by the given object number.
 COSStream getStream()
          Returns the stream of the XRef.
 void setSize(long streamSize)
          Set the size of the XRef stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFXRefStream

public PDFXRefStream()
Create a fresh XRef stream like for a fresh file or an incremental update.

Method Detail

getStream

public COSStream getStream()
                    throws java.io.IOException
Returns the stream of the XRef.

Returns:
the XRef stream
Throws:
java.io.IOException - if something went wrong

addTrailerInfo

public void addTrailerInfo(COSDictionary trailerDict)
Copy all Trailer Information to this file.

Parameters:
trailerDict - dictionary to be added as trailer info

addEntry

public void addEntry(COSWriterXRefEntry entry)
Add an new entry to the XRef stream.

Parameters:
entry - new entry to be added

setSize

public void setSize(long streamSize)
Set the size of the XRef stream.

Parameters:
streamSize - size to bet set as stream size

getObject

public COSObject getObject(int objectNumber)
Returns the object referenced by the given object number.

Specified by:
getObject in interface PDFXRef
Parameters:
objectNumber - the object to be returned
Returns:
the object corresponding to the given object number