public static void writeInetAddress(InetAddress address, DataOutput out) throws IOException {

    InternalDataSerializer.checkOut(out);

    if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
      logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing InetAddress {}", address);
    }

    StaticSerialization.writeInetAddress(address, out);
  }
Writes an instance of <code>InetAddress</code> to a <code>DataOutput</code>. The
<code>InetAddress</code> is data serialized by writing its {@link InetAddress#getAddress byte}
representation to the <code>DataOutput</code>. {@link #readInetAddress} converts the
<code>byte</code> representation to an instance of <code>InetAddress</code> using
{@link InetAddress#getAddress}. As a result, if <code>address</code> is an instance of a
user-defined subclass of <code>InetAddress</code> (that is, not an instance of one of the
subclasses from the <code>java.net</code> package), its class will not be preserved. In order
to be able to read an instance of the user-defined class,
{@link #writeObject(Object, DataOutput)} should be used. This method will handle a
<code>null</code> value and not throw a <code>NullPointerException</code>.

@param address the <code>InetAddress</code> to write
@param out the {@link DataInput} to write to

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

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