code: public void close() {
          open = false;
          try {
              os.flush();
              if (closeStream)
                  os.close();
          }
          catch(IOException ioe) {
              throw new ExceptionConverter(ioe);
          }
      }
docs: Signals that the <CODE>Document</CODE> was closed and that no other
  <CODE>Elements</CODE> will be added.