public void writeData(PdxWriter writer, Object obj, AutoClassInfo autoClassInfo) {
    PdxWriterImpl w = (PdxWriterImpl) writer;
    boolean optimizeFieldWrites = false;
    if (autoClassInfo.getSerializedType() != null) {
      // check to see if we have unread data for this instance
      if (w.initUnreadData() == null) {
        // we don't so we can optimize the field writes since
        // we will write them in the correct order
        optimizeFieldWrites = true;
      }
    }
    for (PdxFieldWrapper f : autoClassInfo.getFields()) {
      // System.out.println("DEBUG writing field=" + f.getField().getName() + " offset=" +
      // ((PdxWriterImpl)writer).position());
      if (f.transform()) {
        try {
          Object newValue =
              getOwner().writeTransform(f.getField(), obj.getClass(), f.getObject(obj));
          f.serializeValue(w, newValue, optimizeFieldWrites);
        } catch (Exception ex) {
          f.handleException(true, obj, ex);
        }
      } else {
        f.serialize(w, obj, optimizeFieldWrites);
      }
      if (f.isIdentityField() && w.definingNewPdxType()) {
        try {
          w.markIdentityField(f.getName());
        } catch (Exception ex) {
          handleException(ex, true, f.getName(), obj);
        }
      }
    }
    if (autoClassInfo.getSerializedType() == null) {
      autoClassInfo.setSerializedType(w.getAutoPdxType());
    }
  }
Using the given PdxWriter, write out the fields which have been passed in.

@param writer the <code>PdxWriter</code> to use when writing the object
@param obj the object to serialize
@param autoClassInfo a <code>List</code> of <code>Field</code>s which are to be written out
geode-core/src/main/java/org/apache/geode/pdx/internal/AutoSerializableManager.java