code: public void endDocument() throws IOException {
          endChangesIfNecessary();
          ResponseWriter writer = getWrapped();
          /*
           * Because during a <script> writing an exception can occur we need to
           * make sure the wrapped response only writes one partial-response, but
           * also calls to end the document (so we can properly cleanup in the 
           * wrapped HtmlResponseWriter). See issue #3473.
           */
          if (!(writer instanceof PartialResponseWriter)) {
              writer.endElement("partial-response");
          }
          writer.endDocument();
      }
docs: <p class="changed_added_2_0">Write the end of a partial response.</p>
  
  @throws IOException if an input/output error occurs
  @since 2.0