avoid unnecessary call to eof in readbytes if all requested bytes have been read