viewSingle method
Returns a view of a single element at index (takes element
size into account).
Any modifications to the data will also alter the Memory object.
Throws an UnsupportedError if called on a pointer with an @unsized
type argument.
Implementation
@extra
ByteData viewSingle(int index) {
final int? s = size;
if (s != null) {
return boundMemory.buffer.asByteData(address + index * s, s);
} else {
throw UnsupportedError('viewSingle is not supported for unsized types!');
}
}