ウィキっとく?
ファイルコピー
最終更新:
wikittoku
-
view
ファイルコピー
-
チャネルを使ったファイルコピー
private void fileCopy(File in, File out) throws IOException { FileChannel infc = null; FileChannel outfc = null; try { infc = new FileInputStream(in).getChannel(); outfc = new FileOutputStream(out).getChannel(); infc.transferTo(0, infc.size(), outfc); } finally { if (infc != null) { infc.close(); } if (outfc != null) { outfc.close(); } } }