126 is 0000 0000 0111 1110 in binary. We truncate it form the left to groups of seven: 0000000 1111110 and then encode it as usual (least significant group first): 1 1111110 0 0000000. It takes two bytes to encode, but so does the zig-zag encoding.
In fact, the zig-zag encoding and the two's complement encoding always take the same number of bytes to encode a given number. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.