code: protected void write(String toWrite) throws IOException  {
      if(!okToWrite)
        throw new IOException("file not open for writing.");
  
      if(printToScreen)
        System.out.print(toWrite);
  
      try {
        out.write(DFSUtil.string2Bytes(toWrite));
      } catch (IOException e) {
        okToWrite = false;
        throw e;
      } 
    }
docs: Write parameter to output file (and possibly screen).
  
  @param toWrite Text to write to file