An end-of-file controlled loop
depends on fact that readLine
returns null if there is no more data