Java print protobuf object of unknown type

Viewed 1632

Consider that I have byte array - byte[] which represent some kind of serialized protobuf object. Is there any way to print it to output, something like

1: 123
2: Jhon
3: Doe
4: 0

Where 1 is int field, 2 and 3 are strings and 4 is boolen

TextFormat.print requires me to provide concrete Builder of protobuf object, which I do not know.

2 Answers
Related