u8

Bun

Symbol

read.u8

function u8(ptr: Pointer, byteOffset?: number): number

The read function behaves similarly to DataView, but it's usually faster because it doesn't need to create a DataView or ArrayBuffer.

@param ptr

The memory address to read

@param byteOffset

bytes to skip before reading

While there are some checks to catch invalid pointers, this is a difficult thing to do safely. Passing an invalid pointer can crash the program and reading beyond the bounds of the pointer will crash the program or cause undefined behavior. Use with care!

Referenced types

type Pointer = number & { __pointer__: null }