|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
org.eclipse.ercp.xml.io.XmlInputStreamReader
public class XmlInputStreamReader
Implement a dedicated InputStreamReader for an XML file which can change dynamically for an other encoding Used when reading an XML file...
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
XmlInputStreamReader(java.io.InputStream in)
Constructs a new XmlInputStreamReader on the InputStream in . |
|
XmlInputStreamReader(java.io.InputStream in,
java.lang.String ianaEncoding)
Constructs a new XmlInputStreamReader on the InputStream in . |
Method Summary | |
---|---|
void |
close()
Close this Reader. |
int |
read()
Reads a single character from this reader and returns the result as an int. |
int |
read(char[] buf,
int offset,
int count)
Reads at most count characters from this Reader and stores them
at offset in the character array buf . |
void |
setEncoding(java.lang.String ianaEncoding)
|
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlInputStreamReader(java.io.InputStream in) throws java.io.IOException
in
. The default
buffer size (2K) is allocated and all reads can now be filtered through this stream.
in
- the InputStream to buffer reads on.
java.io.IOException
public XmlInputStreamReader(java.io.InputStream in, java.lang.String ianaEncoding) throws java.io.IOException
in
. The
buffer size is specified by the parameter size
and all reads can
now be filtered through this XmlInputStreamReader.
in
- the InputStream to buffer reads on.enc
- the java encoding name.
java.io.IOException
Method Detail |
---|
public void setEncoding(java.lang.String ianaEncoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public final int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
- If the Reader is already closed or some other IO error occurs.public final int read(char[] buf, int offset, int count) throws java.io.IOException
count
characters from this Reader and stores them
at offset
in the character array buf
. Returns the
number of characters actually read or -1 if the end of reader was encountered.
read
in class java.io.Reader
buf
- character array to store the read charactersoffset
- offset in buf to store the read characterscount
- maximum number of characters to read
java.io.IOException
- If the Reader is already closed or some other IO error occurs.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
- If an error occurs attempting to close this Reader.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |