字符输入转换流:
package com.gao;
import java.io.*;
public class transfer_stream {
public static void main(String[] args) throws Exception {
InputStream in = new FileInputStream("E:\\黑马教育\\demo.txt");
Reader re = new InputStreamReader(in,"GBK");
BufferedReader bf = new BufferedReader(re);
String line;
while ((line=bf.readLine())!= null){
System.out.println(line);
}
}
}
字符输出转换流: