Re: [protobuf] Why protocol buffer c++ library not reading binary objects properly?

2011-12-09 Thread Christopher Head
Protobuf messages are not aware of their own sizes, and you haven't told the input stream how many bytes of message it should consume. Try this: coded_input->ReadLittleEndian32(&objtype); coded_input->ReadLittleEndian32(&objlen); CodedInputStream::Limit lim = coded_input->PushLimit(objlen); tMsg.P

[protobuf] Why protocol buffer c++ library not reading binary objects properly?

2011-12-08 Thread alok
I created a binary file using a c++ program using protocol buffers. I had issues reading the binary file in my C# program, so I decided to write a small c++ program to test the reading. My proto file is as follows message TradeMessage { required double timestamp = 1; required string ric_code = 2;