BufferedReader.ready() doesn't know about lines
Make a new class that has a BufferedReader as a member, and
runs as a separate thread. The thread simple executes a loop
beginning with BufferedReader.readLine(). After that returns,
it sets a boolean flag to show that a line is really ready,
then waits until that flag is reset before continuing round the
loop again.
The public interfacxe to this class has a ready() method that
just returns the state of the flag, and a readLine() method that
should only be called if the flag is true, when it clears the flag,
and returns the string last read in the loop.