public static void writeFile(File file, DataOutput out) throws IOException {

    InternalDataSerializer.checkOut(out);

    if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
      logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing File {}", file);
    }

    writeString((file != null) ? file.getCanonicalPath() : null, out);
  }
Writes an instance of <code>File</code> to a <code>DataOutput</code>. Note that even though
<code>file</code> may be an instance of a subclass of <code>File</code>, <code>readFile</code>
will always return an instance of <code>File</code>, <B>not</B> an instance of the subclass. To
preserve the class type of <code>file</code>, {@link #writeObject(Object, DataOutput)} should
be used for data serialization. This method will handle a <code>null</code> value and not throw
a <code>NullPointerException</code>.

@param file the <code>File</code> to write
@param out the {@link DataInput} to write to

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

@see #readFile
@see File#getCanonicalPath
geode-core/src/main/java/org/apache/geode/DataSerializer.java