Bytes.view constructor

Bytes.view(
  1. Uint8List data, [
  2. int offsetInBytes = 0,
  3. int? length
])

Wraps a Uint8List view starting at offsetInBytes.

Implementation

factory Bytes.view(Uint8List data, [int offsetInBytes = 0, int? length]) {
  final len = length ?? (data.length - offsetInBytes);
  RangeError.checkValidRange(offsetInBytes, offsetInBytes + len, data.length);
  return Bytes._(data, offsetInBytes, len);
}