I have an istream and I have to read it into a buffer. I could not find a way to figure out the read_len once eof is encountered? I cannot use get because my file does not have delimeters.
It seems that the only option is to read it character by character, is it really the only option?
char buffer[128];
while(is.good()) {
is.read(buffer, sizeof(buffer));
size_t read_len = sizeof(buffer);
if (is.eof()) {
read_len = xxxx;
}
process(buffer, read_len);
}