Skip to main content

Module buffer_utils

Module buffer_utils 

Source
Expand description

Buffer utilities for synchronous varint and string encoding/decoding

These utilities work on in-memory byte slices and are used for parsing compressed block data and constructing query packets.

Functionsยง

read_string
Read a length-prefixed string from a byte slice
read_varint
Read a varint-encoded u64 from a byte slice
write_string
Write a length-prefixed string to a byte buffer
write_varint
Write a varint-encoded u64 to a byte buffer
write_varint_to_vec
Write a varint to a raw Vec<u8> (convenience for tests)