second read can throw, check eof() after first reading