code: protected final void finishWritingTextFile() throws IOException {
      assert tmpfile != null : "No text file is currently being written";
      writeblob(tmpname, toBytes(tmpfile));
      tmpfile = null;
    }
docs: Finish writing a text file.