One confusing thing about that example is that the bytes are written in hex
but they look like decimal. You are right that the encoded bytes in decimal
are 08, 150, 01, but in hex that is equal to 08, 96, 01.

On Fri, Apr 7, 2017 at 6:42 PM, <shga...@gmail.com> wrote:

> In the encoding section of the manual:
>
> https://developers.google.com/protocol-buffers/docs/encoding
>
> For the 'Test1 message and set a to 150'
>
> the example states the code would read:
>
> 08 96 01
>
> Shouldn't this be: 08 150 01 (00001000, 10010110, 00000001) -> (00000001, 
> 10010110 [0000001+0010110])
>
> 08 (Tag 1 and Type 0 varint)
>
> 150 (22 with MSB set)
>
> 01 (128 bit from prior byte at first bit, MSB not set)
>
> Just looking for some clarification since I can't see 96 anywhere in the 
> example.
>
> 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.
>

-- 
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