Its very efficient, whilst keeping flexibility. To stream it, I add 3+
bytes.
Start byte
Length byte(s)
ProtoWrapper (which includes message type enumerator)
ProtoMessage
End byte
Once the Length byte is read, I verify that the end byte is where it
should be before deserialising (just in case the client is sending buggy
messages, and you loose sync).
All my message types are defind in a large enumerator. I'm hoping one
day the protobuf compiler will build that for me.
Stuart.