Int8Pointer#
Extension on Pointer specialized for the type argument Int8.
Properties#
value extension read / write#
The 8-bit two's complement integer at address.
A Dart integer is truncated to 8 bits (as if by .toSigned(8)) before
being stored, and the 8-bit value is sign-extended when it is loaded.
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
external int get value;
external void set value(int value);
Methods#
asTypedList() extension#
Creates a typed list view backed by memory in the address space.
The returned view will allow access to the memory range from address
to address + sizeOf<Int8>() * length.
The user has to ensure the memory range is accessible while using the returned list.
If provided, finalizer will be run on the pointer once the typed list
is GCed. If provided, token will be passed to finalizer, otherwise
the this pointer itself will be passed.
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
external Int8List asTypedList(
int length, {
@Since('3.1') Pointer<NativeFinalizerFunction>? finalizer,
@Since('3.1') Pointer<Void>? token,
});
deprecated elementAt() extension#
DEPRECATED
Use operator + instead
Pointer arithmetic (takes element size into account).
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
@Deprecated('Use operator + instead')
Pointer<Int8> elementAt(int index) =>
Pointer.fromAddress(address + sizeOf<Int8>() * index);
Operators#
operator +() extension#
A pointer to the offsetth Int8
after this one.
Returns a pointer to the Int8
whose address is
offset times the size of Int8
after the address of this pointer.
That is (this + offset).address == this.address + offset * sizeOf<Int8>().
Also (this + offset).value is equivalent to this[offset],
and similarly for setting.
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
@Since('3.3')
@pragma("vm:prefer-inline")
Pointer<Int8> operator +(int offset) =>
Pointer.fromAddress(address + sizeOf<Int8>() * offset);
operator -() extension#
A pointer to the offsetth Int8
before this one.
Equivalent to this + (-offset).
Returns a pointer to the Int8
whose address is
offset times the size of Int8
before the address of this pointer.
That is, (this - offset).address == this.address - offset * sizeOf<Int8>().
Also, (this - offset).value is equivalent to this[-offset],
and similarly for setting,
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
@Since('3.3')
@pragma("vm:prefer-inline")
Pointer<Int8> operator -(int offset) =>
Pointer.fromAddress(address - sizeOf<Int8>() * offset);
operator []() extension#
The 8-bit two's complement integer at address + sizeOf<Int8>() * index.
A Dart integer is truncated to 8 bits (as if by .toSigned(8)) before
being stored, and the 8-bit value is sign-extended when it is loaded.
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
external int operator [](int index);
operator []=() extension#
The 8-bit two's complement integer at address + sizeOf<Int8>() * index.
A Dart integer is truncated to 8 bits (as if by .toSigned(8)) before
being stored, and the 8-bit value is sign-extended when it is loaded.
Available on Pointer<T extends NativeType>, provided by the Int8Pointer extension
Implementation
external void operator []=(int index, int value);