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

    Class BinaryReader

    Bounds-checked cursor over a Uint8Array for reading Kafka protocol primitives.

    On success the reader advances its position; on failure the position is unchanged.

    Index

    Constructors

    Accessors

    • get remaining(): number

      Number of bytes remaining from the current position.

      Returns number

    Methods

    • 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, …

      Returns DecodeResult<number>

    • 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.

      Returns DecodeResult<number>