getBytes method

Uint8List getBytes(
  1. int index,
  2. int length
)

Reads length bytes beginning at index (inclusive) into a Uint8List.


Exceptions:

Implementation

Uint8List getBytes(int index, int length) {
  assertWriteable(index, length);
  var list = Uint8List(length);
  for (var i = 0; i < length; i++) {
    list[i] = getByte(index + i);
  }
  return list;
}