I don't think this is correct. `each_line` keeps a buffer internally, and so if you do `read_line(); read()` you're going to get the wrong result.