1.字符输入流
1.java.io.Reader:字符输入流,抽象类
具体的子类:字节输入流通向字符输入流的桥梁:InputStreamReader
2.字符缓冲输入流:
构造方法:
public InputStreamReader(InputStream in):使用默认字符集进行解码
public InputStreamReader(InputStream in,String charsetName)throws UnsupportedEncodingException:使用指定的字符集解码
读的方式:
public int read() throws IOException:一次读取一个字符
public int read(char[] cbuf)throws IOException:一次读取一个字符数组
3.public class ReaderDemo{
public static void mian(String[] args) throws Exception{
InputStreamReader isr = new InputStreamReader(new FileInputStream("osw.txt"));
char[] chs = new char[1024];
int len = 0;
while((len=isr.read(