Hello.

Please check my understanding of protobuf serialization and defaults.

I understand that if the value of a protobuf field is the same as the 
default, then its not serialized.

Does that mean that if I have a field like

    string foo               = 1 [default=""];

And I explicitly set it to empty string:

bar.setFoo("");

or 

bar.setFoo(fooString); // fooString=""

then I get the serialization savings?

Or do I need to do something like:

if ( foo != "" ) {
  bar.setFoo(foo);
}

This is libprotobuf version 2.50, using Java

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to