I have the following example of reading from a buffered reader:
while ((inputLine = input.readLine()) != null) { System.out.println(\"I got a message from
But I do not understand how it works. .... waits until something appears in the buffered reader and when something appears there it returns true
No, it returns the value of the expression (inputLine = input.readLine()), the inputLine itself. The inputLine is compared to null.