public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("io/1.txt");
int len ;
while((len = fis.read()) != -1){
System.out.print((char)len); //如果中文怎么单个输出?
}
fis.close();
}
用字符流是可以的。
但如果用字节流?有方法?