Hi All.

I am trying to detect when I receive a protocol buffer that is not of
the expected type. For example.

void myMethod(byte[] theData)

    TheMsgTypeExpected theMsg = TheMsgTypeExpected.parseFrom(data);

Now, if I pass in a byte[] of a protocol buffer that is of a type that
I do not expect, the parseFrom() still returns correctly, (I would
have though the IOException would have been thrown or something), and
some of the fields get merged (the fields with the same IDs?)

I am confused on how to detect this scenario, and ultimately prevent
such things occurring.

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 
For more options, visit this group at 

Reply via email to