socket that uses the DeserializeWithLengthPrefix() method call. The
C# environment on a windows PC. Why doesn't C++ support the same
On Aug 24, 4:05Â pm, Peter Keen <
peter.k...@gmail.com> wrote:
> You sort of have to roll your own. In my project I'm doing something like this:
>
> coded_output->WriteVarint32(message->ByteSize());
> message->SerializeToCodedStream(coded_output);
>
> And then on the reading side:
>
> uint32_t size;
> if (! coded_input->ReadVarint32(&size)) {
> Â return NULL; // just an example. probably don't want to do this;
>
> }
>
> Message * m = new Message;
> CodedInputStream::Limit limit = coded_input->PushLimit(size);
> message->ParseFromCodedStream(coded_input);
> coded_input->PopLimit(limit);
>
> The biggest thing that helped me along was finding the Limit docs. I
> couldn't figure out how to parse from a ZeroCopyInputStream without
> consuming the entire stream, and then I ran across that and everything
> became much more clear.
>
> --Pete
>