Get the latest tech news

Demystifying the protobuf wire format


A simple explanation of the protocol buffers wire format

For fields that almost always contain large numbers, the varint encoding is inefficient due to the additional continuation bit. Echo our hex encoded bytes Pass them through xxd to transform the hex into binary Pass the binary stream to protoc with the decode flag For protoc to access our sample proto we stored it in the working directory in a file named fruit.proto If you want to dig deeper and understand alternative protocol buffer formats such as protoscope or how other features of protocol buffers such as maps, negative numbers or packed repeated fields are encoded, check out the excellent protobuf encoding guide.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Protobuf Wire Format

Protobuf Wire Format