Yes. You are right. CodedInputStream is a possible solution. This is 
helpful. I also find out that the generated Java protocol buffers code also 
uses it to decode.

Thanks,
Li

On Tuesday, December 30, 2014 10:09:08 AM UTC-8, Henner Zeller wrote:
>
> On 29 December 2014 at 10:53, Li Yan <magma...@gmail.com <javascript:>> 
> wrote: 
> > Hey guys, 
> > 
> > From https://developers.google.com/protocol-buffers/docs/encoding, I 
> > basically understand how to encode protocol buffers: the keys and values 
> are 
> > concatenated into a byte stream. My question is whether there exists API 
> to 
> > partially serialize/deserialize protocol buffers? I mean add serialized 
> > field at binary head, and only deserialize the first n fields in the 
> binary 
> > protocol buffers. 
>
> You could use the CodedInputStream to read one field at a time. 
>
> -h 
>
> > 
> > 
> > Thanks, 
> > Li 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Protocol Buffers" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to protobuf+u...@googlegroups.com <javascript:>. 
> > To post to this group, send email to prot...@googlegroups.com 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/protobuf. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to