@OpenApiAll
public class OOXMLStreamWriter
extends java.io.Writer
Modifier and Type | Field and Description |
---|---|
protected java.util.zip.ZipOutputStream |
zipOutputStream
An internal output stream for ZIP file.
|
Constructor and Description |
---|
OOXMLStreamWriter(java.io.OutputStream out,
java.lang.String entryName)
Create an OOXMLStreamWriter.
|
OOXMLStreamWriter(java.io.OutputStream out,
java.lang.String entryName,
java.lang.String charsetName)
Create an OOXMLStreamWriter that uses the named charset.
|
OOXMLStreamWriter(java.io.OutputStream out,
java.lang.String entryName,
java.lang.String charsetName,
java.io.File fileBuffer)
Create an OOXMLStreamWriter that uses the named charset and file buffer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the stream.
|
void |
closeEntry()
Closes the current OOXML entry and positions the stream for writing the next entry.
|
protected void |
ensureOpen()
Check to make sure that the stream has not been closed.
|
void |
flush()
Flushes the stream.
|
java.io.OutputStream |
getOutputStream()
Returns an output stream for this writer.
|
void |
putNextEntry(OOXMLEntry entry)
Begins writing a new OOXML entry and positions the stream to the start of the entry data.
|
void |
write(byte[] buf,
int offset,
int length)
Writes an array of bytes to the current OOXML entry data.
|
void |
write(char[] cbuf,
int offset,
int length)
Write characters into current entry.
|
void |
write(java.lang.String text)
Write text into current entry.
|
protected java.util.zip.ZipOutputStream zipOutputStream
public OOXMLStreamWriter(java.io.OutputStream out, java.lang.String entryName) throws java.io.IOException
out
- An OutputStreamentryName
- target entry namejava.util.zip.ZipException
- if a ZIP file error has occurredjava.io.IOException
- if an I/O error has occurredpublic OOXMLStreamWriter(java.io.OutputStream out, java.lang.String entryName, java.lang.String charsetName) throws java.io.IOException
out
- An OutputStreamentryName
- target entry namecharsetName
- The name of a supported java.nio.charset.Charset
charset
java.util.zip.ZipException
- if a ZIP file error has occurredjava.io.IOException
- if an I/O error has occurredpublic OOXMLStreamWriter(java.io.OutputStream out, java.lang.String entryName, java.lang.String charsetName, java.io.File fileBuffer) throws java.io.IOException
out
- An OutputStreamentryName
- target entry namecharsetName
- The name of a supported java.nio.charset.Charset
charset
fileBuffer
- use this file to buffer a OOXML content. If no fileBuffer is specified, content will be
stored in memory.java.util.zip.ZipException
- if a ZIP file error has occurredjava.io.IOException
- if an I/O error has occurredprotected void ensureOpen() throws java.io.IOException
java.io.IOException
- If stream has been closedpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
java.io.IOException
- If an I/O error occurspublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
- If an I/O error occurspublic void write(char[] cbuf, int offset, int length) throws java.io.IOException
write
in class java.io.Writer
cbuf
- Array of charactersoffset
- Offset from which to start writing characterslength
- Number of characters to writejava.io.IOException
- If an I/O error occurspublic void write(java.lang.String text) throws java.io.IOException
write
in class java.io.Writer
text
- textjava.io.IOException
- If an I/O error occurspublic java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
- if an I/O error has occurredpublic void putNextEntry(OOXMLEntry entry) throws java.io.IOException
entry
- the OOXML entry to be writtenjava.io.IOException
- if an I/O error has occurredpublic void closeEntry() throws java.io.IOException
java.io.IOException
- if an I/O error has occurredpublic void write(byte[] buf, int offset, int length) throws java.io.IOException
buf
- the data to be writtenoffset
- the start offset in the datalength
- the number of bytes that are writtenjava.io.IOException
- if an I/O error has occurredCopyright © 2010 - No Magic Asia