public static void copyFile(String originalFileName, String destFileName)
throws Exception {
throws Exception {
byte[] buffer = new byte[4096];
int size = -1;
int size = -1;
FileInputStream fis = new FileInputStream(originalFileName);
FileOutputStream fos = new FileOutputStream(destFileName);
FileOutputStream fos = new FileOutputStream(destFileName);
while ((size = fis.read(buffer, 0, buffer.length)) != -1) {
fos.write(buffer, 0, size);
}
fos.write(buffer, 0, size);
}
fis.close();
fos.close();
fos.close();
fis = null;
fos = null;
fos = null;
}
沒有留言:
張貼留言