简体   繁体   中英

Converting base64 proto binary to human readable (json/xml) using .proto schema

I'm new to Google Protobuf. I want to solve an issue and i can't find the answer on the internet, maybe i'm asking the wrong questions..

I want to build a tool which uses a.proto schema (and the generated classes) and convert input strings from readable to base64 string and the reverse (with java) the purpose is to debug the messages. I don't know exactly which message is encoded (so which class to use..)

how can i proceed please? could you give me some pointers, links to projects or anything that may help me..

edit: for the moment, i will try to use ParseFromString function, with every class until i find the protobuf class that matches the base64 blob..

Thank you

Protobuf can be used to serialize data on 1 machine and send it to the 2nd machine where it is de-serialized to the original form.

Protobuf uses its own logic to serialize things like Strings, Signed/Unsigned number values, etc

So knowing this, protobuf cannot/shouldnot be used as a converter to convert things into other things. It is used to transport data accross machine boundaries.

Maybe you just want to convert a String into BASE64 representation without protobuf? Then the hint of Thomas Timbul might be useful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM