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

    Function decode

    • Decode a complete message held in one contiguous buffer, in a single call.

      The non-streaming convenience, and not a second decoder: it is one IStream.feed of the whole buffer, so it runs the same code, applies the same rules and has the same memory behaviour as a chunked decode — §6.7.1 forbids the one-shot path from differing, right down to holding no view into the buffer it was handed. Feeding a whole message is also the case the decoder's fast lane is built for, so nothing is given up by having one implementation.

      The whole buffer is the end of input, so the two failure outcomes both throw a SofabError the caller tells apart by code (MESSAGE_SPEC §7): malformed input throws INVALID_MSG, while input that ends inside a field — truncation or an unclosed sequence — throws INCOMPLETE. A complete message returns normally.

      The receiver caps of §6.2.1 are the visitor's, not this function's: it takes no limits argument because this codec holds none. See IStream.

      Parameters

      • bytes: Uint8Array
      • visitor: Visitor

      Returns void