File copy

// IO Streams
// File handling
// Copy file
 
import java.io.*;
 
class FileCopy
{
     public static void main(String as[]) throws IOException
     {
          FileInputStream fin = new FileInputStream(“F1.txt”);
          FileOutputStream fout = new FileOutputStream(“F2.txt”);
         
          while(true)
          {
              int i = fin.read();
              if(i==-1)
                   break;
              fout.write((char)i);              
          }
          fout.close();
          fin.close();
     }
}