code: @Override
      public E peek() {
          E el;
  
          while (((el = super.peek()) == null) && !isDone()) {
              synchronized (this) {
                  try {
                      wait();
                  } catch (InterruptedException e) {
                      String s = "Reader has been interrupted maybe the connection is closed";
                      throw new RuntimeException(s);
                  }
              }
          }
  
          if ((el == null) && isDone()) {
              String s = "Reader has been interrupted maybe the connection is closed";
              throw new RuntimeException(s);
          }
  
          return el;
      }
docs: Override to make peek() a blocking call.