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.
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 throwsINVALID_MSG, while input that ends inside a field — truncation or an unclosed sequence — throwsINCOMPLETE. 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.