@qualithm/kafka-client - v0.1.6
    Preparing search index...

    Class BinaryWriter

    Auto-growing buffer builder for writing Kafka protocol primitives.

    All write methods return this for fluent chaining.

    Index

    Constructors

    Accessors

    • get offset(): number

      Current write position (number of bytes written so far).

      Returns number

    Methods

    • Write a nullable array with INT32 count prefix (non-flexible versions). Null writes -1 as the count.

      Type Parameters

      • T

      Parameters

      • values: readonly T[] | null
      • writeElement: (writer: BinaryWriter, value: T) => void

      Returns this

    • Write nullable bytes with INT32 length prefix (non-flexible versions). Null writes -1 as the length.

      Parameters

      Returns this

    • Write a nullable compact array (flexible versions, KIP-482). Null writes 0; otherwise writes (count + 1) as unsigned varint.

      Type Parameters

      • T

      Parameters

      • values: readonly T[] | null
      • writeElement: (writer: BinaryWriter, value: T) => void

      Returns this

    • Write nullable compact bytes (flexible versions, KIP-482). Null writes 0; otherwise writes (length + 1) as unsigned varint.

      Parameters

      Returns this

    • Write a nullable compact string (flexible versions, KIP-482). Null writes 0; otherwise writes (length + 1) as unsigned varint.

      Parameters

      • value: string | null

      Returns this

    • Write a signed variable-length integer using zigzag encoding.

      Parameters

      • value: number

      Returns this

    • Write a signed variable-length long using zigzag encoding.

      Parameters

      • value: bigint

      Returns this

    • Write a nullable string with INT16 length prefix (non-flexible versions). Null writes -1 as the length.

      Parameters

      • value: string | null

      Returns this

    • Write tagged fields. Format: unsigned varint count, then for each field: unsigned varint tag, unsigned varint size, then the data bytes.

      Parameters

      Returns this

    • Write an unsigned variable-length integer (up to 5 bytes, 32-bit).

      Parameters

      • value: number

      Returns this

    • Write an unsigned variable-length long (up to 10 bytes, 64-bit).

      Parameters

      • value: bigint

      Returns this