Bytes.copyOf constructor

Bytes.copyOf(
  1. Uint8List data, [
  2. int start = 0,
  3. int? end
])

Copies a range of data.

Implementation

factory Bytes.copyOf(Uint8List data, [int start = 0, int? end]) {
  final e = end ?? data.length;
  RangeError.checkValidRange(start, e, data.length);
  return Bytes._(Uint8List.fromList(data.sublist(start, e)), 0, e - start);
}