http://www.csdn.net/develop/read_article.asp?id=17710

解决方案 »

  1.   

    用FileInputStream和FileOutStream两个类来实现读写
      

  2.   

    import java.io.*;
         class showfile{
           public static void main(String args[])
                throws IOException{
                     int i;
                     FileInputStream fin;
                     FileOutputStream fout;
                     PrintWriter pw=new PrintWriter(System.out,true);
                     try{
                       fin=new FileInputStream("jct.txt");
                     }catch(FileNotFoundException exc){
                          pw.println("File not found");
                          return;
                     }
                     try{
                       fout=new FileOutputStream("test.txt");
                     }catch(FileNotFoundException exc){
                         pw.println("file not found");
                         return;
                     } 
                     do{
                      i=fin.read();
                      if(i!=-1) fout.write(i);
                     }while(i!=-1);
                     fin.close();
                     fout.close();
                }
           }          
                        
     这是拷贝文件的java 原程序,希望对你有帮助
      

  3.   

    第一,你要读什么文件,binary文件还是text文件。
    第二,你要读的文件是在class folder里,还是project folder里。如果你用Jbuilder,就是说你要读的文件是在classes目录下面,还是在project跟目录下面。
      

  4.   

    Thinking in Java 里第十章就是讲文件的读写的,全都是这方面的例子!
      

  5.   

    http://expert.csdn.net/Expert/topic/2052/2052241.xml?temp=.8718225
      

  6.   

    很简单的问题,学一学Java I/O 就OK