我的没有问题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
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
解决方案 »
- 如何记录用户的操作
- 使用Axis2调用.Net WebService遇到的问题
- 框架整合错误
- suse下的Tomcat部署出现http404错误
- 怎么利用AJAX实现对Table字段的填充
- 如何实现点击<frameset>上部链接使得下部页面跳转~~~~~~~~~~~~~~~~~~~
- 谁用过pebble这个开源的blog,怎么在resin免费空间上配置。
- tomcat5.5+j2se 1.5时出现的错误,请大家帮我看一下
- 大虾解释一下weblogic的domain的目录结构!!!
- 求教:jar包导入后在包下面没有类文件
- 想学习java向的webservice,请各位高手推荐些好书和资料吧!
- 各位大侠帮帮忙...JSP问题..急~~~~~~~~~~~
http://community.csdn.net/Expert/topic/5279/5279273.xml具体的问题与错误贴出来
jdk先不要用1.6的