SofaBuffers TypeScript - v0.9.0
    Preparing search index...

    Class IStream

    Push parser for the SofaBuffers wire format. Feed it bytes in chunks of any size with IStream.feed and it drives a Visitor, one call per decoded field, resuming cleanly across chunk boundaries. Call IStream.end after the final chunk to read whether the message finished on a field boundary. When the whole message is already in one buffer, prefer the faster decode.

    Index
    • Report whether the stream ended exactly at a field boundary. Call after the final feed: returns DecodeStatus.Complete at a clean field boundary, or DecodeStatus.Incomplete if the last chunk ended inside a field (a partial varint, an unfinished payload / array, or a still-open nested sequence).

      Per the finish-less spec (MESSAGE_SPEC §7) this is a pure accessor: it never throws and never promotes an incomplete decode to an error — the caller owns end-of-input and decides whether a trailing Incomplete is a truncation error. (A malformed message has already thrown from feed.)

      Returns DecodeStatus

    • Feed a chunk of bytes, dispatching decoded fields to visitor. Throws SofabError (INVALID_MSG) only if the bytes are malformed; running out of bytes mid-field is not an error — it simply suspends until the next chunk (see end).

      Parameters

      • chunk: Uint8Array
      • visitor: Visitor

      Returns void