You can reload the operator β to correctly read integers. Of course, all he does is read () 4 bytes. But what all the other operators β end up doing.
Here is an example (no error checking, assuming endianess matches the current time compiler used, etc.)
std::istream& operator>>(std::istream& in, uint32_t& data) { in.read(&data, sizeof(data)); return in; }
Taylor for your own coloring of integers (you may have to read one byte at a time and assign them an offset, look at the file in a hex editor if you donβt know the byte order), add error checking, and you should be able to use the existing one the code.
EDIT: ah and yes, make sure that this shadow is provided to the stl statement that reads an integer - you may need to extract your own class from the stream you are using and use it instead of std :: istream & in, so the compiler knows who must first check.
Eugene
source share