Hi,
I am using following code while reading through the file stream
while(!coded_input->ExpectAtEnd())
{
coded_input->ReadLittleEndian32(&count);
for(i=0; i<count; i++)
{
coded_input->ReadLittleEndian32(&objtype);
coded_input->ReadLittleEndian32(&objlen);
cout << "Item = "<<++item_count<<" type = "<<objtype<<"
length =
"<<objlen<<endl;
coded_input->Skip(objlen);
}
}
Above code runs in infinite loop. My file has only 14 objects. File
length is 627 bytes only. But ExpectAtEnd() Never returns true in
above example.
What is the right way to check end of file?
Regards,
Alok
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.