code: @Override public ProjectFile read(InputStream stream) throws MPXJException
     {
        try
        {
           m_projectFile = new ProjectFile();
           m_eventManager = m_projectFile.getEventManager();
           m_taskMap = new HashMap<String, Task>();
  
           ProjectConfig config = m_projectFile.getProjectConfig();
           config.setAutoWBS(false);
  
           m_projectFile.getProjectProperties().setFileApplication("GanttDesigner");
           m_projectFile.getProjectProperties().setFileType("GNT");
  
           m_eventManager.addProjectListeners(m_projectListeners);
  
           SAXParserFactory factory = SAXParserFactory.newInstance();
           SAXParser saxParser = factory.newSAXParser();
           XMLReader xmlReader = saxParser.getXMLReader();
           SAXSource doc = new SAXSource(xmlReader, new InputSource(stream));
  
           if (CONTEXT == null)
           {
              throw CONTEXT_EXCEPTION;
           }
  
           Unmarshaller unmarshaller = CONTEXT.createUnmarshaller();
  
           Gantt gantt = (Gantt) unmarshaller.unmarshal(doc);
  
           readProjectProperties(gantt);
           readCalendar(gantt);
           readTasks(gantt);
  
           return m_projectFile;
        }
  
        catch (ParserConfigurationException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        catch (JAXBException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        catch (SAXException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        finally
        {
           m_projectFile = null;
           m_eventManager = null;
           m_projectListeners = null;
           m_taskMap = null;
        }
     }
docs: {@inheritDoc}