On Dec 6, 2010, at 9:05 , Koert Kuipers wrote:
i am still confused why protobuffers does not have a parseFrom()
method in the message Interface. that would have been a lot cleaner
i think. or am i missing something?
Because the serialized representation does not include anything to
describe the type. Thus, based on just the raw bytes, you can't tell
what type of message it is. If you need this functionality, you need
to build it yourself, either using union types:
http://code.google.com/apis/protocolbuffers/docs/techniques.html#union
Or by doing some custom thing (including some unique identifier, or
the fully qualified message name, or something in some header first).
Evan
--
Evan Jones
http://evanjones.ca/
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to proto...@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.