public static void writeClass(Class<?> c, DataOutput out) throws IOException {

    InternalDataSerializer.checkOut(out);

    if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
      logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing Class {}", c);
    }

    if (c == null || c.isPrimitive()) {
      StaticSerialization.writePrimitiveClass(c, out);
    } else {
      // non-primitive classes have a second CLASS byte
      // if readObject/writeObject is called:
      // the first CLASS byte indicates it's a Class, the second
      // one indicates it's a non-primitive Class
      out.writeByte(DSCODE.CLASS.toByte());
      String cname = c.getName();
      cname = InternalDataSerializer.processOutgoingClassName(cname, out);
      writeString(cname, out);
    }
  }
Writes an instance of <code>Class</code> to a <code>DataOutput</code>. This method will handle
a <code>null</code> value and not throw a <code>NullPointerException</code>.

@param c the <code>Class</code> to write
@param out the {@link DataInput} to write to

@throws IOException A problem occurs while writing to <code>out</code>

@see #readClass
geode-core/src/main/java/org/apache/geode/DataSerializer.java