asPptPayload method

LazyMessagePayload asPptPayload({
  1. required LazyPayloadEncoding encoding,
  2. required PackedPayloadDecoder packedPayloadDecoder,
})

Retains already encoded PPT bytes and their native owner without decoding. Use matching PPT options with Session's lazy call/publish APIs. The decoder runs only on application access; it must interpret this encoding/schema.

Implementation

LazyMessagePayload asPptPayload({
  required LazyPayloadEncoding encoding,
  required PackedPayloadDecoder packedPayloadDecoder,
}) {
  _handle.check();
  final bytes = this.bytes;
  NativeOwnedBuffer._pptViews[bytes] = _pptViewIdentity;
  return LazyMessagePayload.packed(
    encoding: encoding,
    packedPayloadBytes: bytes,
    packedPayloadDecoder: packedPayloadDecoder,
    anchor: this,
    storageOwner: (buffer: this, bytes: bytes),
  );
}