C++11: istream.get() stops on EOM
11:20 01 Dec 2014

I have a problem with C++ (C++11) inputstreams, specifically filestreams. After I open a new stream with this:

ifstream stream;
stream.open("C:\somefile.txt");

And when I try to read from it and the read operation encounters an EOM-byte (0x19), the stream is set to badbit which is not what I want. I want to read until the definite end of the file. This is how I read

char buffer[8];
stream.read(buffer, 8);

and then I check like that:

if(stream.fail()) return -1;

How can I read from the stream without stopping at EOM-bytes (or equal)?

c++ c++11 binary istream