Protocol buffers without additional fields: fixed size?

I use Google protocol buffers and try to determine the following:

If my protocol buffer does not have duplicate fields and all fields are necessary, can it be assumed that the buffer will always be the same size regardless of its contents?

Thanks.

+4
source share
1 answer

No. This is a false assumption given the information provided.

Some types (especially Base 128 Varints) use an encoding variable . Also consider Lines (with unspecified payloads) as another counter example.

Happy coding.

+3
source

All Articles