Current write position (number of bytes written so far).
Return a new Uint8Array containing exactly the written bytes.
Reset the write position to 0, allowing buffer reuse.
Write a nullable array with INT32 count prefix (non-flexible versions). Null writes -1 as the count.
Write nullable bytes with INT32 length prefix (non-flexible versions). Null writes -1 as the length.
Write a nullable compact array (flexible versions, KIP-482). Null writes 0; otherwise writes (count + 1) as unsigned varint.
Write nullable compact bytes (flexible versions, KIP-482). Null writes 0; otherwise writes (length + 1) as unsigned varint.
Write a nullable compact string (flexible versions, KIP-482). Null writes 0; otherwise writes (length + 1) as unsigned varint.
Write a signed variable-length integer using zigzag encoding.
Write a signed variable-length long using zigzag encoding.
Write a nullable string with INT16 length prefix (non-flexible versions). Null writes -1 as the length.
Write tagged fields. Format: unsigned varint count, then for each field: unsigned varint tag, unsigned varint size, then the data bytes.
Write an unsigned variable-length integer (up to 5 bytes, 32-bit).
Write an unsigned variable-length long (up to 10 bytes, 64-bit).
Auto-growing buffer builder for writing Kafka protocol primitives.
All write methods return
thisfor fluent chaining.