Class COSWriterObjectStream
java.lang.Object
org.apache.pdfbox.pdfwriter.compress.COSWriterObjectStream
An instance of this class represents an object stream, that compresses a number of
COSObjects in a stream. It
may be added to the top level container of a written PDF document in place of the compressed objects. The document's
PDFXRefStream must be adapted accordingly.- Author:
- Christian Appl
-
Constructor Summary
ConstructorsConstructorDescriptionCOSWriterObjectStream(COSWriterCompressionPool compressionPool) Creates an object stream for compressible objects from the givenCOSWriterCompressionPool. -
Method Summary
Modifier and TypeMethodDescriptionReturns allCOSObjectKeys, that shall be added to the object stream, whenwriteObjectsToStream(COSStream)is called.voidprepareStreamObject(COSObjectKey key, COSBase object) Prepares the givenCOSObjectto be written to this object stream, using the givenCOSObjectKeyas it's ID for indirect references.writeObjectsToStream(COSStream stream)
-
Constructor Details
-
COSWriterObjectStream
Creates an object stream for compressible objects from the givenCOSWriterCompressionPool. The objects must first be prepared for this object stream, by adding them via callingprepareStreamObject(COSObjectKey, COSBase)and will be written to thisCOSStream, whenwriteObjectsToStream(COSStream)is called.- Parameters:
compressionPool- The compression pool an object stream shall be created for.
-
-
Method Details
-
prepareStreamObject
Prepares the givenCOSObjectto be written to this object stream, using the givenCOSObjectKeyas it's ID for indirect references.- Parameters:
key- TheCOSObjectKey, that shall be used for indirect references to theCOSObject.object- TheCOSObject, that shall be written to this object stream.
-
getPreparedKeys
Returns allCOSObjectKeys, that shall be added to the object stream, whenwriteObjectsToStream(COSStream)is called.- Returns:
- All
COSObjectKeys, that shall be added to the object stream.
-
writeObjectsToStream
- Parameters:
stream- The stream for the compressed objects.- Returns:
- The given
COSStreamof this object stream. - Throws:
IOException- Shall be thrown, if writing the object stream failed.
-