I am new and want to understand the purpose/usage of default values in
the .proto file. E.g:
optional string a 1 [default ="test"];
When I create a message object and read the field value, the default
will be displayed:
But when I serialise, write to a file, and inspect the binary message,
the default is absent:
ofstream file("wire_message", std::ios::out | std::ios::binary);
If the default values aren't serialised, what is their purpose? What's
the rationale for not serialising them?
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at