java.lang.Object
org.sejda.sambox.output.IndirectObjectsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Component that writes pdf objects and keeps track of what has been written to avoid writing an object twice.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIndirectObjectsWriter(org.sejda.io.BufferedCountingChannelWriter writer, PDFWriteContext context) IndirectObjectsWriter(org.sejda.io.CountingWritableByteChannel channel, PDFWriteContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()(package private) PDFWriteContextcontext()private voidlongoffset()protected voidCalled when the input indirect references has just been writtenvoidwrite(byte b) voidwrite(byte[] bytes) voidwrite(InputStream stream) voidvoidwriteEOL()voidWrites the givenIndirectCOSObjectReferenceupdating its offset and releasing it once written.voidWrites the givenIndirectCOSObjectReferenceupdating its offset and releasing it once written.(package private) COSWriterwriter()
-
Field Details
-
OBJ
private static final byte[] OBJ -
ENDOBJ
private static final byte[] ENDOBJ -
LOG
private static final org.slf4j.Logger LOG -
writer
-
context
-
-
Constructor Details
-
IndirectObjectsWriter
IndirectObjectsWriter(org.sejda.io.CountingWritableByteChannel channel, PDFWriteContext context) -
IndirectObjectsWriter
IndirectObjectsWriter(org.sejda.io.BufferedCountingChannelWriter writer, PDFWriteContext context)
-
-
Method Details
-
context
PDFWriteContext context() -
writeObjectIfNotWritten
Writes the givenIndirectCOSObjectReferenceupdating its offset and releasing it once written. The object is written only if not previously already written.- Parameters:
object-- Throws:
IOException
-
writeObject
Writes the givenIndirectCOSObjectReferenceupdating its offset and releasing it once written.- Parameters:
object-- Throws:
IOException
-
onWritten
Called when the input indirect references has just been written- Parameters:
object-
-
doWriteObject
- Throws:
IOException
-
writer
COSWriter writer()- Returns:
- the underlying
COSWriter
-
writeEOL
- Throws:
IOException- See Also:
-
BufferedCountingChannelWriter.writeEOL()
-
write
- Parameters:
bytes-- Throws:
IOException- See Also:
-
BufferedCountingChannelWriter.write(byte[])
-
write
- Parameters:
string-- Throws:
IOException- See Also:
-
BufferedCountingChannelWriter.write(String)
-
write
- Parameters:
b-- Throws:
IOException- See Also:
-
BufferedCountingChannelWriter.write(byte)
-
write
- Parameters:
stream-- Throws:
IOException- See Also:
-
BufferedCountingChannelWriter.write(InputStream)
-
offset
public long offset()- Returns:
- the current offset
- See Also:
-
BufferedCountingChannelWriter.offset()
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-