import java.io.*; public class Demo02InputStreamReader { public static void main(String[] args) throws IOException { InputStreamReader ifr =new InputStreamReader(new FileInputStream("F:\basic\untitled13\src\it\cast\day15\demo05\a.txt"),"GBK");
//读取GBK文件,默认读取UTF-8格式编码文件 int len=0; while ((len=ifr.read())!=-1){ System.out.println((char) len); } ifr.close(); } }