如何仅在Protobuf序列化字节数组中解析一个字段
我只需要一个来自Protobuf序列化字节数组的字段,但是必须调用parsefrom函数,这是低性能的。我如何从字节数组中获得字段偏移,而通过偏移分析值。
I need only one field from protobuf serialize byte array, but must call parseFrom function, which is low performance. how can I get field offset from byte array, and parse value by offset.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如“ nofollow noreferrer”>“ nofollow noreferrer”>“ nofollow noreferrer”>“ nofollow” :
因此,您不能有100%可靠的偏移到一个字段。您需要调用
解析
函数。As mentioned in the Protocol Buffers documentation on fields order:
Therefore you cannot have a 100% reliable offset to a field. You will need to call the
ParseFrom
function.