java文件复制方法参考
最快的文件复制方法
private static void customBufferStreamCopy(File source, File target) { InputStream fis = null; OutputStream fos = null; try { fis = new FileInputStream(source); fos = new FileOutputStream(target); byte[] buf = new byte[4096]; int i; while ((i = fis.read(buf)) != -1) { fos.write(buf, 0, i); } } catch (Exception e) { e.printStackTrace(); } finally { close(fis); close(fos); } }
?