toUint8ListCopy method

Uint8List toUint8ListCopy()

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,
  );
}