c++ - Does google protocol buffers support size calculation before serialization? -


my (dsp) application produces data @ constant rate. rate depends on configuration selected user. know how many bytes generated per second. data structure contains repeated (packed) floating point field. length of field constant, can changed user.

is there protocol buffers function calculate message size before serialization?

it's impossible know ahead of time, because protobuf packs structures given fewest bytes possible - won't use 4 bytes int x = 1; example - library have walk entire graph know output size.

i believe find out doing serialize operation protobuf-compliant stream of own design counts bytes given. costly, no more costly library work.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -