sollex
sollex

Reputation: 11

Java protocol buffers Ascii serialization

It is probably a stupid question, sorry. I recently started using protobufs and I do not seem to figure out how would I parse an ascii file in the protocol buffer defined message? ParseFrom(...) does not seem to work cause it requires a binary serialization.

Thanks

Upvotes: 1

Views: 2117

Answers (1)

jdowdell
jdowdell

Reputation: 1638

http://code.google.com/apis/protocolbuffers/docs/reference/java/com/google/protobuf/TextFormat.html

It's true that in production/performance code you should only be dealing with binary form protocol buffers, but for debugging or convenience there is a well defined human readable format, and all of the interfaces (python, java, C++, etc.) have a means of translating into and out of it.

-former Google engineer.

Upvotes: 5

Related Questions