4 ms·
Remember FLV? What about MP4? Surprise! Both use length prefixing, and stream perfectly fine. Length-prefixing is not a problem for streaming. Hierarchical d
by crabbone 3y ago
Remember FLV? What about MP4? Surprise! Both use length prefixing, and stream perfectly fine.
Length-prefixing is not a problem for streaming. Hierarchical data is, but even then, you have stuff like SAX (for XML).
The problem with Protobuf and why you cannot stream it is that it allows repetition of the same field, and only the last one counts. So, length-prefixing or not, you cannot stream it, unless you are sure that you don't send any hierarchical data (eg. you are sending a list of integers / floats).
Ah, also, another problem: "default fields". Until you parsed the entire message you don't know if default fields are present and whether they need to be initialized on the receiving end.