首页 > 其他 > 详细

读写数据

时间:2017-07-13 19:59:30      阅读:308      评论:0      收藏:0      [点我收藏+]

使用fileinputStream 和FileoutputStream读写文件。

public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
//新建一个对象
FileInputStream in =new FileInputStream("E:/java/qwer/qwer.txt");
//
byte[] a =new byte [100];
int i1 =0;
while(i1 != -1){
System.out.print(new String(a,0,100));//a储存读取数据的缓冲区;0数组a的起始偏移量;读取的最大字节数;
i1 = in.read(a);
}

in.close();
}

}

读写数据

原文:http://www.cnblogs.com/w7589/p/7162190.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!