|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// 复制文件。如果目标文件存在,会被覆盖。
private
static
void
copyFile(File srcFile, File destFile)
throws
IOException {
FileInputStream inStream =
new
FileInputStream(srcFile);
FileOutputStream outStream =
new
FileOutputStream(destFile);
FileChannel inChannel = inStream.getChannel();
FileChannel outChannel = outStream.getChannel();
inChannel.transferTo(
0
, inChannel.size(), outChannel);
inStream.close();
inChannel.close();
outStream.close();
outChannel.close();
}
|
*** walker ***
本文转自walker snapshot博客51CTO博客,原文链接http://blog.51cto.com/walkerqt/1341787如需转载请自行联系原作者
RQSLT