package ohjava;

import java.io.*;

public class OutputFile {

  FileOutputStream fout;

  public OutputFile() {
    fout = null;
  }

  public boolean openFile(String fn) { 
    try {
      fout = new FileOutputStream(fn);
    } catch (Exception e) {
        return false;
      }
    return true;
  }

  public void writeLine(String line) throws Exception {
    line += "\n";
    for (int i=0; i < line.length(); i++)
      fout.write(line.charAt(i));
  } 

  public void closeFile() {
    fout = null;
  }
}