bytes property
Uint8List
bytes
The data contained in the object.
See NSData.bytes
Implementation
Uint8List get bytes {
final bytes = _nsObject.bytes;
if (bytes.address == 0) {
return Uint8List(0);
} else {
// `NSData.byte` has the same lifetime as the `NSData` so make a copy to
// ensure memory safety.
// TODO(https://github.com/dart-lang/ffigen/issues/375): Remove copy.
return Uint8List.fromList(bytes.cast<Uint8>().asTypedList(length));
}
}