rewriteSourceSlot static method

void rewriteSourceSlot(
  1. Uint8List frame,
  2. int srcSlot
)

Rewrites the source slot in place, without copying or parsing.

The hub's entire per-sample cost.

Implementation

static void rewriteSourceSlot(Uint8List frame, int srcSlot) {
  ByteData.view(
    frame.buffer,
    frame.offsetInBytes,
    frame.lengthInBytes,
  ).setUint16(_srcSlotOffset, srcSlot, Endian.little);
}