short read and eof detect