Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.UnsafePointerView

UNSTABLE: Unsafe and new API, beware!

An unsafe pointer view to a memory location as specified by the pointer value. The UnsafePointerView API mimics the standard built in interface DataView for accessing the underlying types at an memory location (numbers, strings and raw bytes).

class UnsafePointerView {
constructor(pointer: bigint);
pointer: bigint;
 
copyInto(destination: TypedArray, offset?: number): void;
getArrayBuffer(byteLength: number, offset?: number): ArrayBuffer;
getBigInt64(offset?: number): PointerValue;
getBigUint64(offset?: number): PointerValue;
getCString(offset?: number): string;
getFloat32(offset?: number): number;
getFloat64(offset?: number): number;
getInt16(offset?: number): number;
getInt32(offset?: number): number;
getInt8(offset?: number): number;
getUint16(offset?: number): number;
getUint32(offset?: number): number;
getUint8(offset?: number): number;
}

§Constructors

§
new UnsafePointerView(pointer: bigint)
[src]

§Properties

§
pointer: bigint
[src]

§Methods

§
copyInto(destination: TypedArray, offset?: number): void
[src]

Copies the memory of the pointer into a typed array. Length is determined from the typed array's byteLength. Also takes optional offset from the pointer.

§
getArrayBuffer(byteLength: number, offset?: number): ArrayBuffer
[src]

Gets an ArrayBuffer of length byteLength at the specified byte offset from the pointer.

§
getBigInt64(offset?: number): PointerValue
[src]

Gets a signed 64-bit integer at the specified byte offset from the pointer.

§
getBigUint64(offset?: number): PointerValue
[src]

Gets an unsigned 64-bit integer at the specified byte offset from the pointer.

§
getCString(offset?: number): string
[src]

Gets a C string (null terminated string) at the specified byte offset from the pointer.

§
getFloat32(offset?: number): number
[src]

Gets a signed 32-bit float at the specified byte offset from the pointer.

§
getFloat64(offset?: number): number
[src]

Gets a signed 64-bit float at the specified byte offset from the pointer.

§
getInt16(offset?: number): number
[src]

Gets a signed 16-bit integer at the specified byte offset from the pointer.

§
getInt32(offset?: number): number
[src]

Gets a signed 32-bit integer at the specified byte offset from the pointer.

§
getInt8(offset?: number): number
[src]

Gets a signed 8-bit integer at the specified byte offset from the pointer.

§
getUint16(offset?: number): number
[src]

Gets an unsigned 16-bit integer at the specified byte offset from the pointer.

§
getUint32(offset?: number): number
[src]

Gets an unsigned 32-bit integer at the specified byte offset from the pointer.

§
getUint8(offset?: number): number
[src]

Gets an unsigned 8-bit integer at the specified byte offset from the pointer.