Best thing is when encoding, group messages by type and preface each group with a type name and FileDescriptorSet which will allow you to decode the rest using a DynamicMessage (see notes on self describing messages on the wiki). As per usual, use coded stream encoding with length prefixing for the FileDescriptorSet, the group, and each message in the group.
--Chris On Apr 11, 2011, at 6:25 PM, yaroslav chinskiy <[email protected]> wrote: > Hi, > > I will have heterogeneous set of protocol buffers. > > I will not know the types and the number until the runtime. > I am planing to create a factory which will convert byte[] to protocol > buffer object. > > What is the best practice? How can I figure out the protocol buffer > out of the byte array? > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
