toBytes method

  1. @override
Uint8List toBytes([
  1. int offset = 0,
  2. int? length
])
override

Returns a copy of the internal bytes (Uint8List) of this instance.

Implementation

@override
Uint8List toBytes([int offset = 0, int? length]) {
  length ??= _length - offset;
  if (length <= 0) {
    return Uint8List(0);
  }

  var bs = Uint8List(length);

  _ioSetPosition(offset);
  _ioReadBytes(bs, 0, length);

  return bs;
}