public class ODFStreamReader
extends java.io.Reader
Modifier and Type | Field and Description |
---|---|
protected ODFEntry |
contentEntry
Keep the entry for content reader.
|
protected ODFXMLReader |
contentReader
An internal reader for specified content entry.
|
protected java.util.zip.ZipInputStream |
zipInputStream
An internal input stream for ZIP file.
|
Constructor and Description |
---|
ODFStreamReader(java.io.InputStream in)
Create an ODFStreamReader with default charset.
|
ODFStreamReader(java.io.InputStream in,
java.lang.String entryName)
Create an ODFStreamReader by specified entry name .
|
ODFStreamReader(java.io.InputStream in,
java.lang.String entryName,
java.lang.String charsetName)
Create an ODFStreamReader by specified entry name and charset.
|
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.
|
ODFEntry |
getContentEntry()
Returns the ODF file entry for the reader, or null if not found.
|
ODFEntry |
getNextEntry()
Reads the next ODF file entry and positions the stream at the beginning of the entry data.
|
void |
init(java.lang.String entryName)
Initialize ODF stream.
|
boolean |
isClosed()
Return true if stream already closed.
|
int |
read(byte[] b,
int off,
int len)
Reads from the current ODF 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 ODFXMLReader contentReader
protected ODFEntry contentEntry
public ODFStreamReader(java.io.InputStream in) throws java.io.IOException
in
- An InputStreamjava.io.IOException
- if an I/O error has occurredpublic ODFStreamReader(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 ODFStreamReader(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 ODFEntry 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 boolean isClosed()
public 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 ODFEntry getNextEntry() throws java.io.IOException
java.io.IOException
- if an I/O error has occurredCopyright © 2010 - No Magic Asia