code: @Override public void write(ProjectFile projectFile, OutputStream out) throws IOException
     {
        m_projectFile = projectFile;
        m_eventManager = projectFile.getEventManager();
  
        if (m_useLocaleDefaults == true)
        {
           LocaleUtility.setLocale(m_projectFile.getProjectProperties(), m_locale);
        }
  
        m_delimiter = projectFile.getProjectProperties().getMpxDelimiter();
        m_writer = new OutputStreamWriter(new BufferedOutputStream(out), projectFile.getProjectProperties().getMpxCodePage().getCharset());
        m_buffer = new StringBuilder();
        m_formats = new MPXJFormats(m_locale, LocaleData.getString(m_locale, LocaleData.NA), m_projectFile);
  
        try
        {
           write();
        }
  
        finally
        {
           m_writer = null;
           m_projectFile = null;
           m_resourceModel = null;
           m_taskModel = null;
           m_buffer = null;
           m_locale = null;
           m_formats = null;
        }
     }
docs: {@inheritDoc}