binaryImportChanges method

int binaryImportChanges(
  1. Uint8List data, {
  2. Object? origin,
})

Imports Changes from the compact binary format.

Returns the number of Changes that were applied.

origin is reported on the HandlerDelta events this produces, and is null when none is given. Pass the object a consumer tags its own writes with, so it can skip its own echo; a HandlerReset carries none. A nested call that names none keeps the origin of the outer one.

Implementation

int binaryImportChanges(Uint8List data, {Object? origin}) {
  _ensureNotDisposed('binaryImportChanges');

  return importChanges(
    [
      for (final blob in ChangeCodec.decodeBlobs(data))
        Change.fromBytes(blob),
    ],
    origin: origin,
  );
}