标签:throw java nio throws void 实现 div exception channel exce
public class TransferTo { public static void main(String[] args) throws Exception { FileChannel in = new FileInputStream("src/demo20/data.txt").getChannel(), out = new FileOutputStream("src/demo20/data2.txt").getChannel(); in.transferTo(0, in.size(), out); } }
通过nio来实现,transferTo方法即可实现.真的简单,不用写循环什么的,具体方法参考文档.
标签:throw java nio throws void 实现 div exception channel exce
原文地址:https://www.cnblogs.com/lishuaiqi/p/10597326.html