Package org.apache.poi.poifs.filesystem
Class DocumentOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.poi.poifs.filesystem.DocumentOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public final class DocumentOutputStream extends OutputStream
This class provides methods to write a DocumentEntry managed by aPOIFSFileSysteminstance.
-
-
Constructor Summary
Constructors Constructor Description DocumentOutputStream(DirectoryEntry parent, String name)Create an OutputStream to create the specified new EntryDocumentOutputStream(DocumentEntry document)Create an OutputStream from the specified DocumentEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longsize()voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Constructor Detail
-
DocumentOutputStream
public DocumentOutputStream(DocumentEntry document) throws IOException
Create an OutputStream from the specified DocumentEntry. The specified entry will be emptied.- Parameters:
document- the DocumentEntry to be written- Throws:
IOException
-
DocumentOutputStream
public DocumentOutputStream(DirectoryEntry parent, String name) throws IOException
Create an OutputStream to create the specified new Entry- Parameters:
parent- Where to create the Entryname- Name of the new entry- Throws:
IOException
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
size
public long size()
- Returns:
- the amount of written bytes
-
-