我的没有问题import java.net.*;
import java.util.*;
import java.io.*;
import java.nio.*;
import java.nio.channels.*;class Test 
{
public static void main(String[] args) 
{
copyFlie(args[0],args[1]);
    }
    
    public static void copyFlie(String srcFilename, String dstFilename)
{
    try
    {
        FileChannel srcChannel = 
                (new FileInputStream(srcFilename)).getChannel();
        FileChannel dstChannel = 
                (new FileOutputStream(dstFilename)).getChannel();
        dstChannel.transferFrom(srcChannel, 0L, srcChannel.size());
        srcChannel.close();
        dstChannel.close();
    }
    catch (Exception e)
    {
     e.printStackTrace();
  //log.error("copy [" + srcFilename + "] to [" + dstFilename + "] except:" + e);
    }

}java Test C:\1.txt C:\2.txt

解决方案 »

  1.   

    Sorry,回错了,应当是这里的
    http://community.csdn.net/Expert/topic/5279/5279273.xml具体的问题与错误贴出来
      

  2.   

    这两个服务器下面写的东西不能兼容,这是肯定的,resin对汉字支持要比tomcat强,tomcat还要强制转码!
      

  3.   

    同意楼上的.resin功能比较强大,你可以看看中国人就是用resin做的。应该没有什么问题的,我经常在两中WEB服务下互相转换,比较简单,你可以贴出具体报错信息。
      

  4.   

    换一下tomcat的版本试试
    jdk先不要用1.6的