On one machine, serialized a Message2, which has been extended from
The parameters in Mesage2 were set using setExtension API. Did
writeDelimitedTo to write to a byte outpurstream.
Then ran protoc --include_imports --descriptor_set_out=message2.desc --
On the other machine:
Got the .desc file here, create a inputstream from it.
DescriptorProtos.FileDescriptorSet fileDescriptorSet =
Created a descripter map and created the dynamic message:
DynamicMessage dynamicMessage = DynamicMessage.parseFrom(descriptor,
when trying to print
System.out.println(" allFields.size =
unknownFields.tostring = "+dynamicMessage.getUnknownFields());
The fields in the Message2 are coming as the unknown fields, tried to
provide the extension registry, but not sure how to do that.
How can we dynamically parse the names and values of the fields in the
extended message2, with the .desc file. or is there other way to do
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at