class FileLineConsumer implements LineConsumer {

  @Override
  public void writeLine(String line) throws IOException {
    if (isOpen) {
      try {
        if (line != null) {
          writer.write(line);
        }
        writer.write('\n');
        writer.flush();
      } catch (IOException e) {
        if ("Stream closed".equals(e.getMessage())) {
          throw new ConsumerAlreadyClosedException(e.getMessage());
        }
        throw e;
      }
    }
  }

  public  FileLineConsumer(File file);

}