Can't you use ByteSize() method to get the size?


On Sunday, April 21, 2013 12:07:57 AM UTC-4, Sean Nguyen wrote:
> 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 it is the outer most 
> message. Is that correct? If it is not where I can find it?
> Thanks,
> Son Nguyen

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to