Ende.UnsafePointerView
class
class Ende.UnsafePointerViewAn unsafe pointer view to a memory location as specified by the pointer
value. The UnsafePointerView API follows the standard built in interface
DataView for accessing the underlying types at an memory
location (numbers, strings and raw bytes).
Constructors
constructor
new UnsafePointerView(pointer: PointerObject)Static methods
getCString
static getCString(pointer: PointerObject, offset?: number): stringGets a UTF-8 encoded string at the specified byte offset from the specified pointer until 0 byte.
Returned string doesn't include U+0000 character.
Invalid UTF-8 characters are replaced with U+FFFD character in the returned string.
getArrayBuffer
static getArrayBuffer(pointer: PointerObject, byteLength: number, offset?: number): ArrayBufferGets an ArrayBuffer of length byteLength at the specified byte
offset from the specified pointer.
copyInto
static copyInto(pointer: PointerObject, destination: AllowSharedBufferSource, offset?: number): voidCopies the memory of the specified pointer into a typed array.
Length is determined from the typed array's byteLength.
Also takes optional byte offset from the pointer.
Properties
pointer
pointer: PointerObjectMethods
getBool
getBool(offset?: number): booleanGets a boolean at the specified byte offset from the pointer.
getUint8
getUint8(offset?: number): numberGets an unsigned 8-bit integer at the specified byte offset from the pointer.
getInt8
getInt8(offset?: number): numberGets a signed 8-bit integer at the specified byte offset from the pointer.
getUint16
getUint16(offset?: number): numberGets an unsigned 16-bit integer at the specified byte offset from the pointer.
getInt16
getInt16(offset?: number): numberGets a signed 16-bit integer at the specified byte offset from the pointer.
getUint32
getUint32(offset?: number): numberGets an unsigned 32-bit integer at the specified byte offset from the pointer.
getInt32
getInt32(offset?: number): numberGets a signed 32-bit integer at the specified byte offset from the pointer.
getBigUint64
getBigUint64(offset?: number): bigintGets an unsigned 64-bit integer at the specified byte offset from the pointer.
getBigInt64
getBigInt64(offset?: number): bigintGets a signed 64-bit integer at the specified byte offset from the pointer.
getFloat32
getFloat32(offset?: number): numberGets a signed 32-bit float at the specified byte offset from the pointer.
getFloat64
getFloat64(offset?: number): numberGets a signed 64-bit float at the specified byte offset from the pointer.
getPointer
getPointer<T = unknown>(offset?: number): PointerValue<T>Gets a pointer at the specified byte offset from the pointer
getCString
getCString(offset?: number): stringGets a UTF-8 encoded string at the specified byte offset until 0 byte.
Returned string doesn't include U+0000 character.
Invalid UTF-8 characters are replaced with U+FFFD character in the returned string.
getArrayBuffer
getArrayBuffer(byteLength: number, offset?: number): ArrayBufferGets an ArrayBuffer of length byteLength at the specified byte
offset from the pointer.
copyInto
copyInto(destination: AllowSharedBufferSource, offset?: number): voidCopies the memory of the pointer into a typed array.
Length is determined from the typed array's byteLength.
Also takes optional byte offset from the pointer.