writeBlob method

void writeBlob(
  1. int id,
  2. Uint8List value, [
  3. int? length
])

Writes an opaque blob (fixlen subtype blob, CORELIB_PLAN §4.6): the first length bytes of value, all of them when omitted — so an InlineBytes' storage and length go out as they are, uncopied.

Implementation

void writeBlob(int id, Uint8List value, [int? length]) {
  final n = _countOf(length, value.length);
  _writeHeaderAndVarint(id, WireType.fixlen, (n << 3) | FixlenType.blob);
  _writeRaw(value, 0, n);
}