lengthfollowed
Lengthfollowed is a design convention in data encoding and communication protocols in which each variable-length field is preceded by a length indicator that specifies the number of bytes that follow. This arrangement allows parsers to determine field boundaries without relying on delimiters or external separators, improving robustness and memory safety in both binary and text formats.
In practice, lengthfollowed overlaps with and is often part of length-prefixed schemes such as TLV (Type-Length-Value).
Examples: An 8-bit length prefix followed by payload where length indicates number of payload bytes. A protocol
Advantages include deterministic parsing, improved validation, and support for streaming parsing. Limitations include potential overhead, endianness
See also: length-prefixed encoding, TLV, framing, streaming parser.