Input files are buffered, so the current contents of the buffer are returned if the buffer is not empty, otherwise reading from the file is attempted first.
See also:
Ways to use read :