public static void writeProperties(Properties props, DataOutput out) throws IOException {
    InternalDataSerializer.checkOut(out);

    Set<Map.Entry<Object, Object>> s;
    int size;
    if (props == null) {
      s = null;
      size = -1;
    } else {
      s = props.entrySet();
      size = s.size();
    }
    InternalDataSerializer.writeArrayLength(size, out);
    if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
      logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing Properties with {} elements: {}", size,
          props);
    }
    if (size > 0) {
      for (Map.Entry<Object, Object> entry : s) {
        // although we should have just String instances in a Properties
        // object our security code stores byte[] instances in them
        // so the following code must use writeObject instead of writeString.
        Object key = entry.getKey();
        Object val = entry.getValue();
        writeObject(key, out);
        writeObject(val, out);
      }
    }
  }
Writes a <code>Properties</code> to a <code>DataOutput</code>.
<P>
NOTE: The <code>defaults</code> of the specified <code>props</code> are not serialized.
<p>
Note that even though <code>props</code> may be an instance of a subclass of
<code>Properties</code>, <code>readProperties</code> will always return an instance of
<code>Properties</code>, <B>not</B> an instance of the subclass. To preserve the class type of
<code>props</code>, {@link #writeObject(Object, DataOutput)} should be used for data
serialization.

@param props the Properties to write
@param out the {@link DataInput} to write to

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

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