IO

来源:互联网 发布:spss syntax 导入数据 编辑:程序博客网 时间:2024/06/03 19:19
IO
File 类用来获取文件或者目录属性


InputStream is=new  FileInputStream("路径")
int length=is.read(字节数组)
is.close();


OutputStream os=new FileOutputStream("路径")
os.write(字节数组)
os.close();


Reader r=new FileReader("路径")
int length=r.read(字符数组);
r.close();


Write w=new FileWriter("路径");
w.write(内容);
w.close();
原创粉丝点击