Package com.itextpdf.kernel.pdf
Class PdfOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.itextpdf.io.source.OutputStream<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 OutputStream<PdfOutputStream>
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
closeDict
protected PdfEncryption
crypto
Contains the business logic for cryptography.protected PdfDocument
document
Document associated with PdfOutputStream.private static byte[]
endIndirect
private static byte[]
endIndirectWithZeroGenNr
private static byte[]
endstream
private static org.slf4j.Logger
LOGGER
private static byte[]
openDict
private static byte[]
stream
-
Fields inherited from class com.itextpdf.io.source.OutputStream
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 boolean
checkEncryption(PdfStream pdfStream)
protected boolean
containsFlateFilter(PdfStream pdfStream)
protected byte[]
decodeFlateBytes(PdfStream stream, byte[] bytes)
private static boolean
decodeParamsArrayNotFlushed(PdfStream pdfStream)
private static boolean
isFlushed(PdfDictionary dict, PdfName name)
private boolean
isNotMetadataPdfStream(PdfStream pdfStream)
private boolean
isXRefStream(PdfStream pdfStream)
protected void
updateCompressionFilter(PdfStream pdfStream)
(package private) void
write(int bytes, int size)
Writes corresponding amount of bytes from a given int(package private) void
write(long bytes, int size)
Writes corresponding amount of bytes from a given longprivate void
write(PdfArray pdfArray)
private void
write(PdfDictionary pdfDictionary)
private void
write(PdfIndirectReference indirectReference)
private void
write(PdfLiteral literal)
private void
write(PdfName name)
private void
write(PdfNumber pdfNumber)
PdfOutputStream
write(PdfObject pdfObject)
Write a PdfObject to the outputstream.private void
write(PdfPrimitiveObject pdfPrimitive)
private void
write(PdfStream pdfStream)
private void
write(PdfString pdfString)
-
Methods inherited from class com.itextpdf.io.source.OutputStream
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.IOException
Writes 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.IOException
Writes 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)
-
-