com.caucho.vfs.i18n
Class JDKReader

java.lang.Object
  extended by java.io.Reader
      extended by com.caucho.vfs.i18n.EncodingReader
          extended by com.caucho.vfs.i18n.JDKReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class JDKReader
extends EncodingReader

Reader to handle any encoding by passing it to the JDK.


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
JDKReader()
          Null-arg constructor for instantiation by com.caucho.vfs.Encoding only.
 
Method Summary
 java.io.Reader create(java.io.InputStream is, java.lang.String javaEncoding)
          Create a JDK-based reader.
 int read()
          Reads into a character buffer using the correct encoding.
 
Methods inherited from class com.caucho.vfs.i18n.EncodingReader
close, create, getJavaEncoding, read, setJavaEncoding
 
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

JDKReader

public JDKReader()
Null-arg constructor for instantiation by com.caucho.vfs.Encoding only.

Method Detail

create

public java.io.Reader create(java.io.InputStream is,
                             java.lang.String javaEncoding)
                      throws java.io.UnsupportedEncodingException
Create a JDK-based reader.

Specified by:
create in class EncodingReader
Parameters:
is - the input stream providing the bytes.
javaEncoding - the JDK name for the encoding.
Returns:
an InputStreamReader
Throws:
java.io.UnsupportedEncodingException

read

public int read()
         throws java.io.IOException
Reads into a character buffer using the correct encoding.

Specified by:
read in class EncodingReader
Returns:
the next character or -1 on end of file.
Throws:
java.io.IOException