public static void copyFile(File fromFile,File toFile) throws IOException{
FileInputStream ins = new FileInputStream(fromFile);
FileOutputStream out = new FileOutputStream(toFile);
byte[] b = new byte[1024];
int n=0;
while((n=ins.read(b))!=-1){
out.write(b, 0, n);
}
ins.close();
out.close();
}
java复制文件
最新推荐文章于 2024-06-14 17:48:16 发布