at_end_of_stream succeeds right after the last character from the current input stream has been read. It also succeeds if there is no valid input stream.