Class NDocumentOutputStream
java.lang.Object
java.io.OutputStream
org.docx4j.org.apache.poi.poifs.filesystem.NDocumentOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This class provides methods to write a DocumentEntry managed by a
NPOIFSFileSystem instance.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStreamour buffer, when null we're into normal blocksprivate booleanhave we been closed?private NPOIFSDocumentthe actual Documentprivate intthe Document's sizeprivate DocumentPropertyand its Propertyprivate NPOIFSStreamour main block stream, when we're into normal blocksprivate OutputStream -
Constructor Summary
ConstructorsConstructorDescriptionNDocumentOutputStream(DirectoryEntry parent, String name) Create an OutputStream to create the specified new EntryNDocumentOutputStream(DocumentEntry document) Create an OutputStream from the specified DocumentEntry. -
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Field Details
-
_document_size
private int _document_sizethe Document's size -
_closed
private boolean _closedhave we been closed? -
_document
the actual Document -
_property
and its Property -
_buffer
our buffer, when null we're into normal blocks -
_stream
our main block stream, when we're into normal blocks -
_stream_output
-
-
Constructor Details
-
NDocumentOutputStream
Create an OutputStream from the specified DocumentEntry. The specified entry will be emptied.- Parameters:
document- the DocumentEntry to be written- Throws:
IOException
-
NDocumentOutputStream
Create an OutputStream to create the specified new Entry- Parameters:
parent- Where to create the Entryname- Name of the new entry- Throws:
IOException
-
-
Method Details
-
dieIfClosed
- Throws:
IOException
-
checkBufferSize
- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-