private static void copyFile(File readFile,File writeFile)
{
try
{
FileChannel fChannel = new FileInputStream(readFile).getChannel();
FileChannel tChannel = new FileOutputStream(writeFile).getChannel();
fChannel.transferTo(0, fChannel.size(), tChannel);
fChannel.close();
tChannel.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
复制文件
最新推荐文章于 2023-03-13 14:23:59 发布