Re: [protobuf] Reading and writing multiple messages to a file

2010-12-22 Thread Kenton Varda
You can only have one CodedInputStream wrapping a ZeroCopyInputStream at a time, otherwise they will confuse each other with buffering conflicts. CodedInputStreams are cheap to construct, so you can just make one on the stack in a block, like: { CodedInputStream coded_input(input_stream_p.g

[protobuf] Reading and writing multiple messages to a file

2010-12-21 Thread rodrigo benenson
Hello all ! I am trying to save multiple Protocol Buffer messages into a file and then reading them back. All messages (except the first) have the same type. My code now works. But I had to use a workaround instead. The code looks as follows. boost::uint64_t size; const bool read_size_s