public static void writeEnum(Enum e, DataOutput out) throws IOException {

    InternalDataSerializer.checkOut(out);

    if (e == null) {
      throw new NullPointerException(
          "The enum constant to serialize is null");
    }

    if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
      logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing enum {}", e);
    }
    InternalDataSerializer.writeArrayLength(e.ordinal(), out);
  }
Writes the <code>Enum constant</code> to <code>DataOutput</code>. Unlike standard java
serialization which serializes both the enum name String and the ordinal, GemFire only
serializes the ordinal byte, so for backward compatibility new enum constants should only be
added to the end of the enum type.<br>
Example: <code>DataSerializer.writeEnum(DAY_OF_WEEK.SUN, out);</code>

@param e the Enum to serialize
@param out the {@link DataInput} to write to

@see #readEnum(Class, DataInput)
@since GemFire 6.5
@throws IOException if a problem occurs while writing to <code>out</code>
geode-core/src/main/java/org/apache/geode/DataSerializer.java