Reader类是java.io.InputStream类的镜像。
public abstract class Reader{
protected Reader(){}
protected Reader(Object lock){}
public abstract int read(char[] text,int offset,int length) throws IOException;
public int read() throws IOException{}
public int read(char[] text) throws IOException{}
public long skip(long n) throws IOException{}
public boolean ready(){}
public boolean markSupported(){}
public void mark(int readAheadLimit) throws IOException{}
public void reset() throws IOException{}
public abstract void close() throws IOException{}
}
read()方法将一个Unicode字符作为一个int返回,可以是0到65535之间的一个值,或者在流结束时返回-1。
InputStreamReader是Reader的最重要的子类。
InputStreamReader从其底层输入流(如FileInputStream或TelnetInputStream)中读取字节。它根据指定的编码方式将这些字节转化为字符,并返回这些字符。
public InputStreamReader(InputStream in){}
public InputStreamReader(InputStream in,String encoding) throws UnsupportedEncodingException{}