Hi, Jon,

Am Donnerstag, 7. Juni 2018 15:05:17 UTC+2 schrieb Jon Skeet:
>
> On Thursday, 7 June 2018 10:59:34 UTC+1, Markus Schaber wrote:
>>
>> This text is missing some interesting aspects, e. G. what happens when 
>> the field number needs more than 5 bits (I cannot imagine it's limited to 
>> 31 fields per message).
>>
>
> No, that's already described:
>
> > Each key in the streamed message is a varint with the value 
> (field_number << 3) | wire_type – in other words, the last three bits of 
> the number store the wire type.
>
> And slightly earlier there's a description of how varints are serialized. 
> So if you have a field number of (say) 1000 and a wire format of 1, that 
> tag would be serialized as the varint encoding of the number 8001, which is 
> (1000 << 3) | 1.
>

Yes, you're right - I was somehow reading this as a byte, not a varint... 
:-(

Thanks!

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to