toUint8ListCopy method
Returns a copy of the written bytes. The length will be equal to length.
Implementation
Uint8List toUint8ListCopy() {
// Create a copy
final byteData = toByteDataCopy();
// Return a view at the copy
return new Uint8List.view(
byteData.buffer,
byteData.offsetInBytes,
byteData.lengthInBytes,
);
}