import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * This class implements a number of UNIX like applications.
 *
 * @author fpereira
 *
 */
public class FileCopier0 {

  /**
   * This method copies the contents of an input file into an output file.
   *
   * @param srcFileName
   *        the name of the file from where data will be read.
   * @param dstFileName
   *        the name of the file into which data will be written.
   * @throws IOException In case we have problems to read the input file.
   */
  public final void cp(final String srcFileName, final String dstFileName)
      throws IOException {
    FileOutputStream dstFile = new FileOutputStream(new File(dstFileName));
    FileInputStream srcFile = new FileInputStream(new File(srcFileName));
    for (int data = srcFile.read(); data >= 0; data = srcFile.read()) {
      dstFile.write(data);
    }
    dstFile.close();
    srcFile.close();
  }

}
