一.分类
- 字节流(不适用于文本)
- InputStream
- OutputStream
- 字符流
- Reader
- Writer
二.字符流
按照字符为单位,英文1-1,中文看是UTF-8编码还是GBK编码
- 字符输出流(Write)
- 字符输入流(Reader)
- 缓冲字符流BufferedReader:方法更多
- 转换流:InputStreamReader:将字节流转化成字符流
//1.将字节流穿环卫字符流
InputStreamReader isr=new InputStreamReader(new BufferedInputStream(new FileInputStream("str/*.txt"))); //2.读取字符流
BufferedReader br = new BufferedReader(isr);
System.out.println(br.readLine());