public void toData(DataOutput out, SerializationContext context, boolean useShadowKey)
        throws IOException {
      if (preserializedBuffer != null) {
        preserializedBuffer.rewind();
        preserializedBuffer.sendTo(out);
      } else if (refCount > 1) {
        KnownVersion v = StaticSerialization.getVersionForDataStream(out);
        HeapDataOutputStream hdos = new HeapDataOutputStream(1024, v);
        basicToData(hdos, context, useShadowKey);
        preserializedBuffer = hdos;
        preserializedBuffer.sendTo(out);
      } else {
        basicToData(out, context, useShadowKey);
      }
    }
Apply a single tx entry op on the far side
geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java