java - How to convert from Json to Protobuf? -


i'm new using protobuf, , wondering if there simple way convert json stream/string protobuf stream/string in java?

for example,

protostring = converttoproto(jsonstring) 

i have json string want parse protobuf message. so, want first convert json string protobuf, , call message.parsefrom() on it.

thanks in advance help!

with proto3 can using jsonformat. parses directly json representation, there no need separately calling mymessage.parsefrom(...). should work:

jsonformat.parser().merge(json_string, builder); 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -