@Override
  public void toData(DataOutput out,
      SerializationContext context) throws IOException {
    DataSerializer.writeObject(eventID, out);
    DataSerializer.writeObject(getRegion().getFullPath(), out);
    out.writeByte(op.ordinal);
    DataSerializer.writeObject(getKey(), out);
    DataSerializer.writeInteger(keyInfo.getBucketId(), out);
    DataSerializer.writeObject(basicGetNewValue(), out);

    byte flags = 0;
    if (putAllOp != null) {
      flags |= HAS_PUTALL_OP;
    }
    if (removeAllOp != null) {
      flags |= HAS_REMOVEALL_OP;
    }
    DataSerializer.writeByte(flags, out);

    // handle putAll
    if (putAllOp != null) {
      putAllToData(out, context);
    }
    // handle removeAll
    if (removeAllOp != null) {
      removeAllToData(out, context);
    }
  }
TODO DISTTX: callers of this constructor need to make sure that release is called. In general
the distributed tx code needs to be reviewed to see if it correctly handles off-heap.
geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java