readBytes method
Get the bytes from the current index to the length
Example:
final input = Input.fromHex('0x010203');
print(input.readBytes(3)); // [1, 2, 3]
Implementation
@override
UnmodifiableUint8ListView readBytes(int length) {
if ((offset + length) > _buffer.length) {
throw Exception('Not enough bytes to read');
}
final bytes =
UnmodifiableUint8ListView(_buffer.buffer.asUint8List(offset, length));
offset += length;
return bytes;
}