文件操作

//将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()

 

转载于:https://www.cnblogs.com/fan615/p/5552496.html

你可能感兴趣的:(文件操作)