如何在Java中解析.pb文件? [英] How to parse .pb files in Java?

查看:943
本文介绍了如何在Java中解析.pb文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有.proto和.pb文件.我需要使用Java解析.pb文件. 我不打算如何使用此.pb文件.请有人可以帮助我解析.pb文件吗?

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?

推荐答案

假设* .pb文件是其内容符合* .proto规范的文件,则可以使用该协议为* .pb文件生成读取器Google提供的缓冲代码: http://code.google.com/p/protobuf/

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/

有专门针对Java的教程,内容涉及如何生成读者和反序列化消息.看看 https://developers.google.com/protocol-buffers/docs/javatutorial 以获得更多详细信息.

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.

这篇关于如何在Java中解析.pb文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆