Skip to content Skip to sidebar Skip to footer

Parsing Protocol Buffers, Written In Java And Read In Python

I am dealing with a situation where the protocol buffers have been written to in Java, but I have to read them using Python. I have the .proto file with me, I have compiled it usin

Solution 1:

I had similar issue for me this worked:

In Java you do:

yourGeneratedClass.toByteArray()

In Python you do(parsed message in result):

result = your_pb2.yourGeneratedClass()
result.ParseFromString(body)

Post a Comment for "Parsing Protocol Buffers, Written In Java And Read In Python"