code: protected void writeManifest2Zip(CmsXmlSaxWriter xmlSaxWriter) throws IOException, SAXException {
  
          // close the document
          xmlSaxWriter.endDocument();
          xmlSaxWriter.getWriter().close();
  
          // create ZIP entry for the manifest XML document
          ZipEntry entry = new ZipEntry(CmsImportExportManager.EXPORT_MANIFEST);
          m_exportZipStream.putNextEntry(entry);
  
          // complex substring operation is required to ensure handling for very large export manifest files
          StringBuffer result = ((StringWriter)xmlSaxWriter.getWriter()).getBuffer();
          int steps = result.length() / SUB_LENGTH;
          int rest = result.length() % SUB_LENGTH;
          int pos = 0;
          for (int i = 0; i < steps; i++) {
              String sub = result.substring(pos, pos + SUB_LENGTH);
              m_exportZipStream.write(sub.getBytes(OpenCms.getSystemInfo().getDefaultEncoding()));
              pos += SUB_LENGTH;
          }
          if (rest > 0) {
              String sub = result.substring(pos, pos + rest);
              m_exportZipStream.write(sub.getBytes(OpenCms.getSystemInfo().getDefaultEncoding()));
          }
  
          // close the zip entry for the manifest XML document
          m_exportZipStream.closeEntry();
  
          // finally close the zip stream
          m_exportZipStream.close();
      }
docs: Writes the OpenCms manifest.xml file to the ZIP export.<p>
  
  In case of the ZIP export the manifest is written to an internal StringBuffer
  first, which is then stored in the ZIP file when this method is called.<p>
  
  @param xmlSaxWriter the SAX writer to use
  
  @throws SAXException in case of issues creating the manifest.xml
  @throws IOException in case of file access issues