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 =
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