Current byte offset within the buffer.
Number of bytes remaining from the current position.
Read a nullable array with INT32 count prefix (non-flexible versions). Count of -1 indicates null.
Read nullable bytes with INT32 length prefix (non-flexible versions). Length of -1 indicates null. Returns a copy of the data.
Read a nullable compact array (flexible versions, KIP-482). Uses unsigned varint for (count + 1); value 0 indicates null.
Read nullable compact bytes (flexible versions, KIP-482). Uses unsigned varint for (length + 1); value 0 indicates null. Returns a copy of the data.
Read a nullable compact string (flexible versions, KIP-482). Uses unsigned varint for (length + 1); value 0 indicates null.
Read length raw bytes as a copy.
Read a signed variable-length integer using zigzag encoding.
Zigzag maps signed integers to unsigned so that small absolute values have small varint encodings: 0 → 0, -1 → 1, 1 → 2, -2 → 3, …
Read a signed variable-length long using zigzag encoding.
Read a nullable string with INT16 length prefix (non-flexible versions). Length of -1 indicates null.
Read tagged fields. Format: unsigned varint count, then for each field:
unsigned varint tag, unsigned varint size, then size bytes of data.
Read an unsigned variable-length integer (up to 5 bytes, 32-bit).
Kafka protocol §5.2: Each byte uses 7 data bits with the high bit as a continuation flag. Least-significant group first.
Read an unsigned variable-length long (up to 10 bytes, 64-bit).
Read 16 bytes as a Kafka UUID.
Bounds-checked cursor over a Uint8Array for reading Kafka protocol primitives.
On success the reader advances its position; on failure the position is unchanged.