I have .proto and .pb files. I need to parse .pb file using Java. I don't about how to use this .pb files. Please can anybody help me to parse .pb files?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Assuming that the *.pb file is a file whose content adheres to the *.proto specification, you can generate readers for the *.pb file using the protocol buffer code Google provides: http://code.google.com/p/protobuf/
There is a tutorial provided specific for Java, on how to generate the readers and deserialize the message. Have a look at https://developers.google.com/protocol-buffers/docs/javatutorial for more details.