/*
 * TODO:
 * 
 * Fill in the body of the methods of the following class.
 * What you are essentially doing is copying the contents
 * of one file to another.
 * 
 **/

import java.io.*;

/** A class that copies files */
public class FileCopier{
  
  
   /**
   * A new file containing the contents of file i.
   * @param i the name of the file.
   * @throws IOException if there is a problem reading from i.
   */
  public static void copy(String inFile, String outFile) throws IOException{   
  
    FileReader reader = new FileReader(inFile);
    BufferedReader br = new BufferedReader(reader);
    
    FileWriter writer = new FileWriter(outFile);
    BufferedWriter wr = new BufferedWriter(writer);
    
    String inline = br.readLine();
    while (inline != null)
    {
      wr.write(inline);
      wr.newLine();
      inline = br.readLine();
    }
    
    br.close();
    wr.close();
    writer.close();
    reader.close();
  }
  
}
