code: private void writeResource(Resource record) throws IOException
     {
        m_buffer.setLength(0);
  
        //
        // Write the resource record
        //
        int[] fields = m_resourceModel.getModel();
  
        m_buffer.append(MPXConstants.RESOURCE_RECORD_NUMBER);
        for (int loop = 0; loop < fields.length; loop++)
        {
           int mpxFieldType = fields[loop];
           if (mpxFieldType == -1)
           {
              break;
           }
  
           ResourceField resourceField = MPXResourceField.getMpxjField(mpxFieldType);
           Object value = record.getCachedValue(resourceField);
           value = formatType(resourceField.getDataType(), value);
  
           m_buffer.append(m_delimiter);
           m_buffer.append(format(value));
        }
  
        stripTrailingDelimiters(m_buffer);
        m_buffer.append(MPXConstants.EOL);
        m_writer.write(m_buffer.toString());
  
        //
        // Write the resource notes
        //
        String notes = record.getNotes();
        if (notes.length() != 0)
        {
           writeNotes(MPXConstants.RESOURCE_NOTES_RECORD_NUMBER, notes);
        }
  
        //
        // Write the resource calendar
        //
        if (record.getResourceCalendar() != null)
        {
           writeCalendar(record.getResourceCalendar());
        }
  
        m_eventManager.fireResourceWrittenEvent(record);
     }
docs: Write a resource.
  
  @param record resource instance
  @throws IOException