public void toData(final DataOutput out,
        SerializationContext context) throws IOException {
      Object key = this.key;
      final Object v = value;
      context.getSerializer().writeObject(key, out);

      if (v instanceof byte[] || v == null) {
        out.writeByte(0);
        DataSerializer.writeByteArray((byte[]) v, out);
      } else if (v instanceof CachedDeserializable) {
        CachedDeserializable cd = (CachedDeserializable) v;
        out.writeByte(IS_CACHED_DESER);
        DataSerializer.writeByteArray(cd.getSerializedValue(), out);
      } else {
        out.writeByte(IS_CACHED_DESER);
        DataSerializer.writeObjectAsByteArray(v, out);
      }
      out.writeByte(op.ordinal);
      byte bits = flags;
      if (filterRouting != null) {
        bits |= FILTER_ROUTING;
      }
      if (versionTag != null) {
        bits |= VERSION_TAG;
        if (versionTag instanceof DiskVersionTag) {
          bits |= PERSISTENT_TAG;
        }
      }
      // TODO: Yogesh, this should be conditional,
      // make sure that we sent it on wire only
      // when parallel wan is enabled
      bits |= HAS_TAILKEY;
      out.writeByte(bits);

      if (filterRouting != null) {
        context.getSerializer().writeObject(filterRouting, out);
      }
      if (versionTag != null) {
        InternalDataSerializer.invokeToData(versionTag, out);
      }
      if (isUsedFakeEventId()) {
        // fake event id should be serialized
        InternalDataSerializer.invokeToData(eventID, out);
      }
      // TODO: Yogesh, this should be conditional,
      // make sure that we sent it on wire only
      // when parallel wan is enabled
      DataSerializer.writeLong(tailKey, out);
    }
Used to serialize this instances data to <code>out</code>. If changes are made to this method
make sure that it is backwards compatible by creating toDataPreXX methods. Also make sure
that the callers to this method are backwards compatible by creating toDataPreXX methods for
them even if they are not changed. <br>
Callers for this method are: <br>
{@link DataSerializableFixedID#toData(DataOutput, SerializationContext)} <br>
{@link DataSerializableFixedID#toData(DataOutput, SerializationContext)} <br>
{@link DataSerializableFixedID#toData(DataOutput, SerializationContext)} <br>
geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java