I’m using Google Protocol buffers and am trying to determine the following:
If my protocol buffer contains no repeating fields, and all fields are required, is it safe to assume the buffer will always be the same size, regardless of its contents?
Thanks.
No. This is not correct assumption given the information provided.
Some types (notably Base 128 Varints) use a variable-encoding. Also consider Strings (with unspecified payloads) as another counter-example.
Happy coding.