Skip to main content

Module bytesio

Module bytesio 

Source
Expand description

Little-endian byte codec shared by the base and WAL formats. All readers return Error::Format rather than panicking on truncated or hostile input, and every length-driven preallocation is capped by Reader::remaining — the two rules the fuzz targets enforce.

Structs§

Reader
A bounds-checked forward reader over untrusted bytes.

Functions§

align_up
Round n up to the next multiple of align (power of two).
get_u16
Read a u16 at a known-good offset (caller has already bounds-checked).
get_u32
Read a u32 at a known-good offset.
get_u64
Read a u64 at a known-good offset.
put_blob
Append a u32-length-prefixed UTF-8 string (large values: SQL, text).
put_f32
Append an f32 LE.
put_len_prefixed
Append u32-length-prefixed bytes.
put_str
Append a u16-length-prefixed UTF-8 string (caller guarantees <= u16::MAX).
put_u8
Append helpers (writers never fail).
put_u16
Append a u16 LE.
put_u32
Append a u32 LE.
put_u64
Append a u64 LE.
put_varint
Append an unsigned LEB128 varint.