title: How to rewrite empty while block
body: <p>I have instantiated a <code>BufferedReader</code> to read an input stream. It has a boolean <code>ready()</code> method that returns false until the reader can be read. Now I have</p>
  
  <pre><code>BufferedReader br = new BufferedReader(new InputStreamReader(myProcess.getInputStream()));
  try {
    while (!br.ready()) {
    }
    String line = br.readLine();
    ...
  } catch (IOException e) {
  ...
  </code></pre>
  
  <p>What PMD warns me about is the empty <code>while</code> block and I guess PMD is right. How can I rewrite the code?</p>