使用FileChannel将一个文件复制到另一个文件
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel;/*来 自 时 代 J a v a*/ public class Main { public void m() { try { // Create channel on the source FileChannel srcChannel = new FileInputStream("srcFilename").getChannel(); // Create channel on the destination FileChannel dstChannel = new FileOutputStream("dstFilename").getChannel(); // Copy file contents from source to destination dstChannel.transferFrom(srcChannel, 0, srcChannel.size());/** 来 自 时 代 J a v