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 aPOIFSFileSystem
instance.
-
-
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 void
close()
long
size()
void
write(byte[] b, int off, int len)
void
write(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:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
size
public long size()
- Returns:
- the amount of written bytes
-
-