Add extra stuff to a “standard” encoding? Sure, why not
Stepping up an abstraction level in this discussion...does anyone have any insight into _why_ an encoding format wouldn&#x27;t want to have length prefixes standardized as part of the expected header of a message? From what I can tell, there isn&#x27;t a strong argument against it; assuming you&#x27;re comfortable with limiting messages to under 2^32 bits, prefixing an unsigned length should only take four bytes per message, which doesn&#x27;t seem like it would ever be a bottleneck, and it allows the receiving side of a message to know up front exactly how much memory to allocate, and it makes it much easier to write correct parsing code that also handles edge cases (e.g. making it obvious to explicitly handle a message that&#x27;s much larger than the amount of memory you&#x27;re willing to allocate). The fact that there are formats out there that don&#x27;t mandate length prefixing makes me think I might be missing something though, so I&#x27;d be interested to hear counterarguments.