首页 > 其他 > 详细

文件操作

时间:2016-06-02 13:12:45      阅读:120      评论:0      收藏:0      [点我收藏+]
//将filepath写入outpath
File file=new File(filepath);
InputStream inputstream=new FileInputStream(file);
FileOutputStream outstream = new FileOutputStream(outpath);
int iBytesRead = 0;
byte[] buffer = new byte[8192];
while ((iBytesRead = inputstream.read(buffer, 0, 8192)) != -1) {
      outstream.write(buffer, 0, iBytesRead);
     }
inputstream.close();
outstream.close()

 

文件操作

原文:http://www.cnblogs.com/fan615/p/5552496.html

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