protocol buffers - Is there one-byte type in protobuf? -


i can't find if there possible have char / byte type in proto.

i can see various types here:

but can't find byte type , int16 types there.

no, there no fixed 1-byte type. fixed length has 4 , 8 byte variants only. other numeric values encoded "varint"s, variable length depending on magnitude (and sign, "zigzag" comes play there). can store bytes value 0-127 in 1 byte, , 128-255 in 2 bytes. 16-bit values take between 1 , 3 bytes depending on magnitude (and sign /zigzag etc).

for multiples, there "bytes" 8-bit version, , "packed" rest; avoids cost of field-header per value.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -