@OpenApiAll
public class OOXMLStreamReader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
protected OOXMLEntry |
contentEntry
Keep the entry for content reader.
|
protected java.io.InputStreamReader |
contentReader
An internal reader for specified content entry.
|
protected java.util.zip.ZipInputStream |
zipInputStream
An internal input stream for ZIP file.
|
Constructor and Description |
---|
OOXMLStreamReader(java.io.InputStream in,
java.lang.String entryName)
Create an OOXMLStreamReader that uses the named charset.
|
OOXMLStreamReader(java.io.InputStream in,
java.lang.String entryName,
java.lang.String charsetName)
Create an OOXMLStreamReader that uses the named charset and entry.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the stream.
|
protected void |
ensureOpen()
Check to make sure that the stream has not been closed.
|
OOXMLEntry |
getContentEntry()
Returns the OOXML file entry for the reader, or null if not found.
|
OOXMLEntry |
getNextEntry()
Reads the next OOXML file entry and positions the stream at the beginning of the entry data.
|
void |
init(java.lang.String entryName)
Initialize ODF stream.
|
int |
read(byte[] b,
int off,
int len)
Reads from the current OOXML entry into an array of bytes.
|
int |
read(char[] cbuf,
int offset,
int length)
Read characters from content.xml into a portion of an array.
|
protected java.util.zip.ZipInputStream zipInputStream
protected java.io.InputStreamReader contentReader
protected OOXMLEntry contentEntry
public OOXMLStreamReader(java.io.InputStream in, java.lang.String entryName) throws java.io.IOException
in
- An InputStreamentryName
- target entry namejava.io.UnsupportedEncodingException
- If the named charset is not supportedjava.io.IOException
- if an I/O error has occurredpublic OOXMLStreamReader(java.io.InputStream in, java.lang.String entryName, java.lang.String charsetName) throws java.io.IOException
in
- An InputStreamentryName
- target entry namecharsetName
- The name of a supported java.nio.charset.Charset
charset
java.io.UnsupportedEncodingException
- If the named charset is not supportedjava.io.IOException
- if an I/O error has occurredpublic void init(java.lang.String entryName) throws java.io.IOException
entryName
- name of target reading entry.java.io.IOException
- If an I/O error occurspublic OOXMLEntry getContentEntry()
protected 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.Reader
java.io.IOException
- If an I/O error occurspublic int read(char[] cbuf, int offset, int length) throws java.io.IOException
read
in class java.io.Reader
cbuf
- Destination bufferoffset
- Offset at which to start storing characterslength
- Maximum number of characters to readjava.io.IOException
- If an I/O error occurspublic int read(byte[] b, int off, int len) throws java.io.IOException
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes readjava.io.IOException
- if an I/O error has occurredpublic OOXMLEntry getNextEntry() throws java.io.IOException
java.io.IOException
- if an I/O error has occurredCopyright © 2010 - No Magic Asia