import java.io.*;标签:read,System,用法,char,主要,fileinputstream,println,fileInputStream,out From: https://www.cnblogs.com/zhaoshengfu/p/18086281
public class Main {
public static void main(String[] args) throws IOException {
//字节流读数据
// FileInputStream fileInputStream = new FileInputStream("C:\\\\Users\\\\31339\\\\Desktop\\\\新建文件夹 (7)\\\\fileinput\\\\zsf.txt");
//fileInputStream.read();
FileOutputStream fileOutputStream = new FileOutputStream("C:\\Users\\31339\\Desktop\\新建文件夹 (7)\\fileinputstram\\zsf.txt");
fileOutputStream.write("zsf".getBytes());
FileInputStream fileInputStream = new FileInputStream("C:\\Users\\31339\\Desktop\\新建文件夹 (7)\\fileinputstram\\zsf.txt");
// System.out.println((char) fileInputStream.read());
/* int by=fileInputStream.read();
System.out.println(by);
System.out.println((char) by);
int by2=fileInputStream.read();
System.out.println(by2);
System.out.println((char) by2);
int by3=fileInputStream.read();
System.out.println(by3);
System.out.println((char) by3);
int by4=fileInputStream.read();
System.out.println(by4);
System.out.println((char) by4);
int by5=fileInputStream.read();
System.out.println(by5);
System.out.println((char) by5);
*/
/* boolean by;
while (by=fileInputStream.read()!=-1){
}
*/
int by;
while ((by = fileInputStream.read()) != -1) {
System.out.print((char) by);
}
fileInputStream.close();
}
}