Re: [protobuf] Re: framing header message -- how to know length?

2018-07-10 Thread Ilia Mirkin
So like I said... you have to write it as To decode it, you can stick the header length as a varint, all via the coded input/output stream. Sample code for encoding: makePacket(Message message) { String name = ... (there has gotta be a way of getting the typename from the message) length =

[protobuf] Re: framing header message -- how to know length?

2018-07-10 Thread John Lilley
Just to wrap this up, here's what I found: You really have to know how big the header message is, because if you simply wrap an input stream around the entire concatenated buffer, the deserialization doesn't know where the end of the header is. This strikes me as a shortcoming of protobuf, but