@Override
  public void toData(DataOutput out,
      SerializationContext context) throws IOException {
    PartitionedRegion region = null;
    try {
      boolean flag = internalDs.getConfig().getDeltaPropagation();
      // Reset the flag when sending full object.
      hasDelta = event.getDeltaBytes() != null && flag && sendDelta;
    } catch (RuntimeException re) {
      throw new InvalidDeltaException(re);
    }
    super.toData(out, context);

    int extraFlags = deserializationPolicy;
    if (bridgeContext != null) {
      extraFlags |= HAS_BRIDGE_CONTEXT;
    }
    if (deserializationPolicy != DistributedCacheOperation.DESERIALIZATION_POLICY_NONE
        && (valObj != null || getValBytes() != null) && sendDeltaWithFullValue
        && event.getDeltaBytes() != null) {
      extraFlags |= HAS_DELTA_WITH_FULL_VALUE;
    }
    if (originalSender != null) {
      extraFlags |= HAS_ORIGINAL_SENDER;
    }
    if (!event.isGenerateCallbacks()) {
      extraFlags |= DO_NOT_GENERATE_CALLBACKS;
    }
    out.writeByte(extraFlags);

    DataSerializer.writeObject(getKey(), out);
    DataSerializer.writeObject(getCallbackArg(), out);
    out.writeLong(lastModified);
    out.writeByte(op.ordinal);
    if (bridgeContext != null) {
      DataSerializer.writeObject(bridgeContext, out);
    }
    if (originalSender != null) {
      DataSerializer.writeObject(originalSender, out);
    }
    InternalDataSerializer.invokeToData(eventId, out);
    if (expectedOldValue != null) {
      DataSerializer.writeObject(expectedOldValue, out);
    }
    if (hasFilterInfo) {
      InternalDataSerializer.invokeToData(filterInfo, out);
    }
    if (hasDelta) {
      try {
        region = PartitionedRegion.getPRFromId(regionId);
      } catch (PRLocallyDestroyedException e) {
        throw new IOException("Delta can not be extracted as region is locally destroyed");
      }
      if (region == null || region.getCachePerfStats() == null) {
        throw new IOException(
            "Delta can not be extracted as region can't be found or is in an invalid state");
      }
      DataSerializer.writeByteArray(event.getDeltaBytes(), out);
      region.getCachePerfStats().incDeltasSent();
    } else {
      DistributedCacheOperation.writeValue(deserializationPolicy, valObj, getValBytes(),
          out);
      if ((extraFlags & HAS_DELTA_WITH_FULL_VALUE) != 0) {
        DataSerializer.writeByteArray(event.getDeltaBytes(), out);
      }
    }
    if (versionTag != null) {
      DataSerializer.writeObject(versionTag, out);
    }
  }
(ashetkar) Strictly for Delta Propagation purpose.

@param o Object of type Delta
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java