How to parse .pb files in Java?

2019-09-09 12:36发布

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条回答
该账号已被封号
2楼-- · 2019-09-09 12:52

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.

查看更多
登录 后发表回答