slice method

Bytes slice(
  1. int start, [
  2. int? end
])

O(1) slice. start and end are relative to this view.

Implementation

Bytes slice(int start, [int? end]) {
  final e = end ?? _length;
  RangeError.checkValidRange(start, e, _length);
  return Bytes._(_buffer, _offset + start, e - start);
}