Package com.itextpdf.kernel.pdf
Class PdfOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.itextpdf.io.source.HighPrecisionOutputStream<PdfOutputStream>
-
- com.itextpdf.kernel.pdf.PdfOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
- Direct Known Subclasses:
PdfWriter
public class PdfOutputStream extends HighPrecisionOutputStream<PdfOutputStream>
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]closeDictprotected PdfEncryptioncryptoContains the business logic for cryptography.protected PdfDocumentdocumentDocument associated with PdfOutputStream.private static byte[]endIndirectprivate static byte[]endIndirectWithZeroGenNrprivate static byte[]endstreamprivate static org.slf4j.LoggerLOGGERprivate static byte[]openDictprivate static byte[]stream-
Fields inherited from class com.itextpdf.io.source.HighPrecisionOutputStream
closeStream, currentPos, outputStream
-
-
Constructor Summary
Constructors Constructor Description PdfOutputStream(java.io.OutputStream outputStream)Create a pdfOutputSteam writing to the passed OutputStream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckEncryption(PdfStream pdfStream)protected booleancontainsFlateFilter(PdfStream pdfStream)protected byte[]decodeFlateBytes(PdfStream stream, byte[] bytes)private static booleandecodeParamsArrayNotFlushed(PdfStream pdfStream)private static booleanisFlushed(PdfDictionary dict, PdfName name)private booleanisNotMetadataPdfStream(PdfStream pdfStream)private booleanisXRefStream(PdfStream pdfStream)protected voidupdateCompressionFilter(PdfStream pdfStream)(package private) voidwrite(int bytes, int size)Writes corresponding amount of bytes from a given int(package private) voidwrite(long bytes, int size)Writes corresponding amount of bytes from a given longprivate voidwrite(PdfArray pdfArray)private voidwrite(PdfDictionary pdfDictionary)private voidwrite(PdfIndirectReference indirectReference)private voidwrite(PdfLiteral literal)private voidwrite(PdfName name)private voidwrite(PdfNumber pdfNumber)PdfOutputStreamwrite(PdfObject pdfObject)Write a PdfObject to the outputstream.private voidwrite(PdfPrimitiveObject pdfPrimitive)private voidwrite(PdfStream pdfStream)private voidwrite(PdfString pdfString)-
Methods inherited from class com.itextpdf.io.source.HighPrecisionOutputStream
assignBytes, close, flush, getCurrentPos, getHighPrecision, getLocalHighPrecision, getOutputStream, isCloseStream, reset, setCloseStream, setHighPrecision, setLocalHighPrecision, write, write, write, writeByte, writeByte, writeBytes, writeBytes, writeDouble, writeDouble, writeFloat, writeFloat, writeFloats, writeInteger, writeLong, writeNewLine, writeSpace, writeString
-
-
-
-
Field Detail
-
stream
private static final byte[] stream
-
endstream
private static final byte[] endstream
-
openDict
private static final byte[] openDict
-
closeDict
private static final byte[] closeDict
-
endIndirect
private static final byte[] endIndirect
-
endIndirectWithZeroGenNr
private static final byte[] endIndirectWithZeroGenNr
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
document
protected PdfDocument document
Document associated with PdfOutputStream.
-
crypto
protected PdfEncryption crypto
Contains the business logic for cryptography.
-
-
Method Detail
-
write
public PdfOutputStream write(PdfObject pdfObject)
Write a PdfObject to the outputstream.- Parameters:
pdfObject- PdfObject to write- Returns:
- this PdfOutPutStream
-
write
void write(long bytes, int size) throws java.io.IOExceptionWrites corresponding amount of bytes from a given long- Parameters:
bytes- a source of bytes, must be >= 0size- expected amount of bytes- Throws:
java.io.IOException
-
write
void write(int bytes, int size) throws java.io.IOExceptionWrites corresponding amount of bytes from a given int- Parameters:
bytes- a source of bytes, must be >= 0size- expected amount of bytes- Throws:
java.io.IOException
-
write
private void write(PdfArray pdfArray)
-
write
private void write(PdfDictionary pdfDictionary)
-
write
private void write(PdfIndirectReference indirectReference)
-
write
private void write(PdfPrimitiveObject pdfPrimitive)
-
write
private void write(PdfLiteral literal)
-
write
private void write(PdfString pdfString)
-
write
private void write(PdfName name)
-
write
private void write(PdfNumber pdfNumber)
-
isNotMetadataPdfStream
private boolean isNotMetadataPdfStream(PdfStream pdfStream)
-
isXRefStream
private boolean isXRefStream(PdfStream pdfStream)
-
write
private void write(PdfStream pdfStream)
-
checkEncryption
protected boolean checkEncryption(PdfStream pdfStream)
-
containsFlateFilter
protected boolean containsFlateFilter(PdfStream pdfStream)
-
updateCompressionFilter
protected void updateCompressionFilter(PdfStream pdfStream)
-
decodeFlateBytes
protected byte[] decodeFlateBytes(PdfStream stream, byte[] bytes)
-
isFlushed
private static boolean isFlushed(PdfDictionary dict, PdfName name)
-
decodeParamsArrayNotFlushed
private static boolean decodeParamsArrayNotFlushed(PdfStream pdfStream)
-
-