docs: public boolean ensureBytes(int n) throws IOException {
      int required = n - endIndex + index;
      while (required > 0) {
        if (!readMore(required)) {
          return false;
        }
        required = n - endIndex + index;
      }
      return true;
    }