Skip to content

LuaByteBuffer

tom5454 edited this page Nov 1, 2023 · 1 revision

LuaByteBuffer

length()

Returns all of the readable bytes in this buffer.

write(values...)

Writes the bytes into the buffer, each parameter is parsed as a single unsigned byte (0-255).

read([amount])

Reads the amount of bytes from the buffer and returns it as unpacked values.
The amount defaults to 1. Negative numbers read all of the available bytes.

available()

Returns the remaining readable bytes in this buffer.

free()

Removes the buffer from the used VRAM amount and marks the buffer invalid.

ref()

Returns a string reference to the buffer.
The reference is only usable on the same peripheral.

Tom's Peripherals Wiki

Clone this wiki locally