private void readWhileReady(BufferedReader reader) throws IOException {
    while (reader.ready() && (character = reader.read()) != -1) {
      stringBuilder.append((char) character);
      if ((char) character == '\n') {
        inputListener.notifyInputLine(stringBuilder.toString());
        stringBuilder = new StringBuilder();
      }
    }
  }
This is a hot reader while there are characters ready to read. As soon as there are no more
characters to read, it returns and the loop invokes shouldTerminate which has a 10 millisecond
sleep until there are more characters ready to read.
geode-core/src/main/java/org/apache/geode/internal/process/NonBlockingProcessStreamReader.java