解决方案 »
- 急急急:Java字体:谁给个FontChooser包呀!!!!!!!!
- 为什么在windown 2000 (server)不能够安装jdk1。5 呀
- 各位帮忙,我想显示在eclipse中断点中变量的值,怎么操作?
- 关于Method类的getDeclaredMethods方法的问题
- 帮帮忙啊!!超级简单的问题,在线等.
- 一个简单的有关图形化编程的问题
- jbuilderx开发web应用,当更新编译一类时,jbuilderx会将此更新同步到web-inf/classes下,但如果是properties或xml文件,那么如何同步了?
- 为什么在APPLET中加入JBUTTON,运行后,需要点击该按钮所在位置,按钮才会显示?
- 如何使用log4j写数据库(100)
- 谁能告诉我COGNOS,SAS都是什么?
- ThreadLocal的缺点
- 正则表达式堆栈溢出怎么破
public static void main(String args[]){
FileInputStream fis = null;
FileOutputStream fos = null;
try{
fis = new FileInputStream("e:/src/from.txt");
fos = new FileOutputStream("e:/src/to.txt");
byte [] buffer = new byte [1024];
int temp = fis.read(buffer,0,buffer.length);
fos.write(buffer,0,temp);
}
catch(Exception e){
System.out.println(e);
}
finally{
try{
fis.close();
fos.close();
}
catch(Exception e){
System.out.println(e);
}
}
}
}看看这个和你的有什么不同,这个反正输出来了;但这个仅仅限于比较小的文件,如果是大的,还得加个while循环吧!楼主看看?
class Text{
public static void main(String args[]){
FileInputStream fis = null;
FileOutputStream fos = null;
try{
fis = new FileInputStream("e:/src/from.txt");
fos = new FileOutputStream("e:/src/to.txt");
byte [] buffer = new byte [1024];
int temp = fis.read(buffer,0,buffer.length);
fos.write(buffer,0,temp);
}
catch(Exception e){
System.out.println(e);
}
finally{
try{
fis.close();
}
catch(Exception e){
System.out.println(e);
}
try{
fos.close();
}
catch(Exception e){
System.out.println(e);
} }
}
}