Package com.itextpdf.kernel.utils
Class MemoryFirstPdfWriter
- java.lang.Object
-
- java.io.OutputStream
-
- com.itextpdf.io.source.OutputStream<PdfOutputStream>
-
- com.itextpdf.kernel.pdf.PdfOutputStream
-
- com.itextpdf.kernel.pdf.PdfWriter
-
- com.itextpdf.kernel.utils.MemoryFirstPdfWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
class MemoryFirstPdfWriter extends PdfWriter
PdfWriter implementation which allows to create documents in memory and dump them on disk on purpose. Currently it's private and used in automated tests only.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
filePath
private static int
MAX_ALLOWED_STREAMS
private java.io.ByteArrayOutputStream
outStream
private static java.util.Map<java.lang.String,MemoryFirstPdfWriter>
waitingStreams
-
Fields inherited from class com.itextpdf.kernel.pdf.PdfWriter
isUserWarnedAboutAcroFormCopying, properties
-
Fields inherited from class com.itextpdf.kernel.pdf.PdfOutputStream
crypto, document
-
Fields inherited from class com.itextpdf.io.source.OutputStream
closeStream, currentPos, outputStream
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
MemoryFirstPdfWriter(java.lang.String filename, WriterProperties properties)
private
MemoryFirstPdfWriter(java.lang.String filename, java.io.ByteArrayOutputStream outputStream, WriterProperties properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
cleanup(java.lang.String path)
private static java.io.ByteArrayOutputStream
createBAOutputStream()
(package private) void
dump()
(package private) static MemoryFirstPdfWriter
get(java.lang.String filename)
(package private) java.io.ByteArrayOutputStream
getBAOutputStream()
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfWriter
copyObject, copyObject, flushModifiedWaitingObjects, flushObject, flushWaitingObjects, getCompressionLevel, getProperties, initCryptoIfSpecified, isFullCompression, setCompressionLevel, setSmartMode, writeHeader, writeToBody
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfOutputStream
checkEncryption, containsFlateFilter, decodeFlateBytes, updateCompressionFilter, write
-
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
-
MAX_ALLOWED_STREAMS
private static final int MAX_ALLOWED_STREAMS
- See Also:
- Constant Field Values
-
waitingStreams
private static java.util.Map<java.lang.String,MemoryFirstPdfWriter> waitingStreams
-
filePath
private java.lang.String filePath
-
outStream
private java.io.ByteArrayOutputStream outStream
-
-
Constructor Detail
-
MemoryFirstPdfWriter
MemoryFirstPdfWriter(java.lang.String filename, WriterProperties properties) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
MemoryFirstPdfWriter
private MemoryFirstPdfWriter(java.lang.String filename, java.io.ByteArrayOutputStream outputStream, WriterProperties properties)
-
-
Method Detail
-
get
static MemoryFirstPdfWriter get(java.lang.String filename)
-
cleanup
static void cleanup(java.lang.String path)
-
dump
void dump() throws java.io.IOException
- Throws:
java.io.IOException
-
getBAOutputStream
java.io.ByteArrayOutputStream getBAOutputStream()
-
createBAOutputStream
private static java.io.ByteArrayOutputStream createBAOutputStream()
-
-