package cn.mldn.demo;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;;
public class TestDemo {
public static void main(String[] args) throws Exception{
File file=new File(“e:”+File.separator+”hello,world”+File.separator+”my.txt”);
if(file.exists()){
InputStream inp=new FileInputStream(file);
byte Byte[]= new byte[1024];
int temp=0;
int foot=0;
while((temp=inp.read())!=-1){
Byte[foot++]=(byte)temp;
}
System.out.println(“{“+”\n”+new String(Byte,0,foot)+”}”);
}
}
}
字节流之Input
最新推荐文章于 2022-09-15 11:58:38 发布