The fields are not 'indexed' in the beginning of the message so that
it is not simple to just jump to a particular field.
What you can do is to direclty use the CodedInputStream to parse
through the message, tag by tag and only read the tags you are
interested in. As soon as you have all fields together, you can stop
reading. So it is a bit manual work involved.
Also, if you want to be faster and skip bigger parts of the message,
make sure to create sub-messages within that message, maybe there is a
logical grouping of your fields ? You can skip a sub-message at once
if you don't need it instead of iterating through all fields in it,
which is faster.
H.
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
>
>
Say I have a packet including a COMMAND field and a big DATA field, and
I should only deserialize this packet to read COMMAND to decide how to process DATA.
The question is: does ProtoBuf copy DATA field when deserializing, and can I avoid that?
A further question:
Can ProtoBuf do in-place deserialization?