|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Reader
com.caucho.vfs.i18n.EncodingReader
public abstract class EncodingReader
Abstract class for a byte-to-character encoding reader and its associated factory.
Implementations need to implementcreate
and read() at minimum. Efficient implementations will
also implement the read into a buffer.
Implementations should not buffer the bytes.
| Field Summary |
|---|
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
EncodingReader()
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the reader, possibly returning it to a pool. |
java.io.Reader |
create(java.io.InputStream is)
Returns a new encoding reader for the given stream and javaEncoding. |
abstract java.io.Reader |
create(java.io.InputStream is,
java.lang.String javaEncoding)
Returns a new encoding reader for the given stream and javaEncoding. |
java.lang.String |
getJavaEncoding()
|
abstract int |
read()
Returns the next character using the correct encoding. |
int |
read(char[] cbuf,
int off,
int len)
Reads into a character buffer using the correct encoding. |
void |
setJavaEncoding(java.lang.String encoding)
|
| 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 EncodingReader()
| Method Detail |
|---|
public java.lang.String getJavaEncoding()
public void setJavaEncoding(java.lang.String encoding)
public abstract java.io.Reader create(java.io.InputStream is,
java.lang.String javaEncoding)
throws java.io.UnsupportedEncodingException
is - the input stream providing the bytes.javaEncoding - the JDK name for the encoding.
java.io.UnsupportedEncodingException
public java.io.Reader create(java.io.InputStream is)
throws java.io.UnsupportedEncodingException
is - the input stream providing the bytes.javaEncoding - the JDK name for the encoding.
java.io.UnsupportedEncodingException
public abstract int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOException
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readercbuf - character buffer receiving the data.off - starting offset into the buffer.len - number of characters to read.
java.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in class java.io.Reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||