I am using google protobuf library to write messages in a file. However these messages do not look binary messages to me. The proto I am using is simple it has Name, Email and Cell No. The file I get is:
*
bilalÈÇbilal@gmail.com"
12345678
If I read back I am able to read it, but this dont look binary data, what i want is writing binary to a file and then parsing it back while reading. I have gone through the API and found that we have multiple methods available for parseFrom(), like:
1) parseFrom(InputStream)
2) parseFrom(CodedInputStream)
3) parseFrom(Byte[])
In the google protobuf tutorials they are using parseFrom(InputStream). And for binary messages i think I need parseFrom(Byte[]). But I dont know how i have to write binary messages. Help is appreciated. My end goal is to read binary messages in a spark dataframe using scalapb.