getBytes method
Reads length
bytes beginning at index
(inclusive) into
a Uint8List.
Exceptions:
-
ReadIndexOutOfRangeException if the current reader index is outside of the bounds of the buffer.
-
BufferOverreadException if the length of the readerIndex + length is outside of the bounds of the buffer.
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;
}