Re: [protobuf] Store number of messages

2011-03-05 Thread ksamdev
Hmm, it makes sense now and explains everything. Unfortunately, I didn't see the way to write fixed width number with CodedOutputStream. Is there a way to do this? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send

Re: [protobuf] Store number of messages

2011-03-04 Thread Henner Zeller
Varint does an encoding whose length changes with the size of the number - hence the name. So it can use between 1 and 10 bytes. So when the value _events_written changes, re-writing the same number at the beginning of the file will use a different number of bytes. If you want to write a number