67,513
社区成员
发帖
与我相关
我的任务
分享
FileOutputStream fs1 = new FileOutputStream("D:\\text1.txt");
fs1.write(1);
fs1.close();
FileInputStream fis1 = new FileInputStream("D:\\text1.txt");
int num1;
String s ="";
while((num1=fis1.read())!=-1){
s =s+num1;
}
System.out.println(s);
FileInputStream fis = new FileInputStream("D:\\text1.txt");
byte[] b = new byte[1024];
int num = fis.read(b);
String str = new String(b,0,num);
System.out.println(str);