Read lines from the input stream