function
ffi.read.u8
byteOffset?: number
): number;
Read an unsigned 8-bit integer at ptr + byteOffset
Behaves like DataView, but is usually faster because it doesn't create a DataView or ArrayBuffer.
Bun catches some invalid pointers, but not all. Passing an invalid pointer, or reading past the end of the memory it points to, can crash the program or cause undefined behavior.
@param ptr
The memory address to read
@param byteOffset
bytes to skip before reading
Referenced types
type Pointer = number & { __pointer__: null }