Decode a complete message held in one contiguous buffer, in a single call.
This is the non-streaming convenience โ and the fast path: with the whole
message in hand it advances one cursor over the buffer instead of running the
resumable per-byte state machine, so it is markedly faster than feeding the
same bytes through
IStream. Use IStream when the message arrives in chunks; use
this when you already have it whole.
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.
Pass limits (DecodeLimits) to cap array counts and string / blob
lengths; an over-limit field throws LIMIT_EXCEEDED at its header, before it
is materialized. Omit for no caps (the default).
Decode a complete message held in one contiguous buffer, in a single call.
This is the non-streaming convenience โ and the fast path: with the whole message in hand it advances one cursor over the buffer instead of running the resumable per-byte state machine, so it is markedly faster than feeding the same bytes through IStream. Use IStream when the message arrives in chunks; use this when you already have it whole.
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 throwsINVALID_MSG, while input that ends inside a field โ truncation or an unclosed sequence โ throwsINCOMPLETE. A complete message returns normally.Pass
limits(DecodeLimits) to cap array counts and string / blob lengths; an over-limit field throwsLIMIT_EXCEEDEDat its header, before it is materialized. Omit for no caps (the default).