A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 邵中国 中级黑马   /  2012-4-19 16:44  /  1868 人查看  /  2 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

import java.io.*;
import java.nio.channels.*;
public class TransforTo {
public static void main (String[] args)throws Exception{
  if(args.length != 2){
   System.out.println("argument : soucefile destfile");
   System.exit(1);
   
  }
  FileChannel in= new FileInputStream(args[0]).getChannel();
  FileChannel out = new FileOutputStream(args[1]).getChannel();
  in.transforTo(0,in.size(),1);                              //zhe
  
}
}

2 个回复

倒序浏览
兄弟,你那一句方法的单词拼写错了,参数也传错了,正确的应该是:in.transferTo(0,in.size(),out);   
最近我也在学习java nio,并做了一些笔记:http://blog.csdn.net/liuxu93466?viewmode=contents
欢迎交流
回复 使用道具 举报
正点
我修改的时候把单词给整乱了
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马