writeJson method

  1. @override
void writeJson(
  1. StringSink sink
)
override

Streaming JSON encoder (#lzdartstreamingjson): writes the canonical JSON for this IpcMessage directly into sink, avoiding the intermediate Map<String, Object> that toWire would produce and (for the Snapshot / Delta / CrdtSync variants) recursing into the payload's own writeJson so the per-batch allocations are eliminated too. Byte-identical to jsonEncode(toWire()).

Implementation

@override
void writeJson(StringSink sink) {
  sink.write('{"Delta":');
  value.writeJson(sink);
  sink.write('}');
}