public static void copyFile(File from, File to) {
try (
FileInputStream inputStream = new FileInputStream(from);
FileOutputStream outputStream = new FileOutputStream(to)
) {
inputStream.transferTo(outputStream);
} catch (IOException e) {
e.printStackTrace();
}
}
网友评论