> > so here the EOF was different and char was signed 7-bit it seems. That makes perfect sense if you're dealing with ASCII, which is a 7-bit character set. But that assumes you were reading "characters" rather than "bytes." Binary data certainly could be any combination of 8 bits and you'd want something out of band to signal errors/eof.