code: private boolean canContinueReading() throws IOException, InterruptedException {
          //If the reader is not ready, gives it some milliseconds
          //It is important to do that, because the ready method guarantees that the readline will not be blocking
          if (!this.reader.ready()) {
              Thread.sleep(this.waitPause);
          }
  
          //If not ready yet, wait a moment to make sure it is finished
          if (!this.reader.ready()) {
              Thread.sleep(50);
          }
  
          return this.reader.ready();
      }
docs: Checks when we the reader can continue to read.