 <p>It makes no sense to clear the buffer.</p> <p>If it were an output buffer e.g. BufferedWriter, then you could flush the buffer to make sure that all buffered content has been written before closing the buffer.<br> In this case you can just close the buffer, after br.readLine() returns null, which means that there is no more input to be read.</p>