clone method

ByteData clone()

Creates a deep copy of the ByteData, mutations to the original will not affect the copy.

Implementation

ByteData clone() {
  Int8List uint8ListView = buffer.asInt8List();
  return Int8List.fromList(uint8ListView).buffer.asByteData(
        offsetInBytes,
        lengthInBytes,
      );
}