Re: [protobuf] how to calculate protocol buffer message size without parsing the full message?

2013-04-21 Thread Marc Gravell
The outermost message is not stored with a length; this allows multiple messages to be merged by concatenation. The default behaviour for a protobuf parser at the root-object is "read until you run out of data". If you have written multiple messages without some kind of "framing" (usually adding

[protobuf] how to calculate protocol buffer message size without parsing the full message?

2013-04-20 Thread Sean Nguyen
Hi, I want to calculate the protocol buffer message size without reading the stream to the end? I don't see the size of the outer most message is stored. For example: message Person { optional string name = 1; optional uint32 age = 2; } There is no size store for the Person message if