java copyFile
public static void copyFile(File oldFile,File newFile) throws IOException{ FileInputStream fis = new FileInputStream(oldFile); FileOutputStream fos = new FileOutputStream(newFile); int index=0; byte[] bytes = new byte[1024]; while((index=fis.read(bytes))!=-1) { fos.write(bytes, 0, index); } fos.flush(); fos.close(); fis.close(); }
##########################
标签:index,java,copyFile,fos,fis,new From: https://www.cnblogs.com/herd/p/16260779.html