You can also copy via serialization: Protocal.parseFrom(dynamicmsg.toByteArray());
On Sun, Sep 2, 2012 at 8:32 PM, qtom zheng <zhfnj...@gmail.com> wrote: > i do like following, and id does success; > > List<FieldDescriptor> fieldlist = >> dynamicmsg.getDescriptorForType().getFields(); >> Protocal.Builder buildermsg = Protocal.newBuilder(); >> for(FieldDescriptor fieldDp : fieldlist){ >> buildermsg.setField(fieldDp, dynamicmsg .getField(fieldDp)); >> } >> Protocal head = buildermsg.build(); > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/protobuf/-/tIhWP_d4DiMJ. > To post to this group, send email to protobuf@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.