JsTypedArrayTransfer class

A native buffer whose ownership can be transferred to a QuickJS TypedArray.

The buffer is allocated outside the Dart heap. Call dispose when it is no longer needed, unless it has been passed to QuickJsRuntime2, in which case QuickJS owns it and will release it during garbage collection.

Constructors

JsTypedArrayTransfer(Pointer<Uint8> pointer, int byteLength, int type)
JsTypedArrayTransfer.allocate({required int byteLength, required int type})
Allocate a buffer suitable for a zero-copy Dart-to-native handoff.
factory

Properties

byteLength int
final
bytes Uint8List
The native-owned bytes. Writes are visible to the eventual JS view.
no setter
hashCode int
The hash code for this object.
no setterinherited
pointer Pointer<Uint8>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transferred bool
no setter
type int
final

Methods

dispose() → void
Release the buffer if ownership has not been transferred.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
takeOwnership() Pointer<Uint8>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited