docs: private boolean readMore(int wanted) throws IOException {
      if (endIndex == index) {
        index = 0;
        endIndex = 0;
      }
      int canFit = buffer.length - endIndex;
      if (canFit < wanted) {
        // would the wanted bytes fit if we compacted the buffer
        // and still leave some slack
        if (index + canFit > wanted + MINIMUM_READ) {
          compact();
        } else {
          doubleBuffer();
        }
        canFit = buffer.length - endIndex;
      }
      int read = wrapped.read(buffer, endIndex, canFit);
      if (read < 0) {
        return false;
      }
      endIndex += read;
      return true;
    }