docs: int inflateBytes(byte[] b, int offset, int length) throws DataFormatException, ZipException {
      checkState(!closed, "GzipInflatingBuffer is closed");
  
      int bytesRead = 0;
      int missingBytes;
      boolean madeProgress = true;
      while (madeProgress && (missingBytes = length - bytesRead) > 0) {
        switch (state) {
          case HEADER:
            madeProgress = processHeader();
            break;
          case HEADER_EXTRA_LEN:
            madeProgress = processHeaderExtraLen();
            break;
          case HEADER_EXTRA:
            madeProgress = processHeaderExtra();
            break;
          case HEADER_NAME:
            madeProgress = processHeaderName();
            break;
          case HEADER_COMMENT:
            madeProgress = processHeaderComment();
            break;
          case HEADER_CRC:
            madeProgress = processHeaderCrc();
            break;
          case INITIALIZE_INFLATER:
            madeProgress = initializeInflater();
            break;
          case INFLATING:
            bytesRead += inflate(b, offset + bytesRead, missingBytes);
            if (state == State.TRAILER) {
              // Eagerly process trailer, if available, to validate CRC.
              madeProgress = processTrailer();
            } else {
              // Continue in INFLATING until we have the required bytes or we transition to
              // INFLATER_NEEDS_INPUT
              madeProgress = true;
            }
            break;
          case INFLATER_NEEDS_INPUT:
            madeProgress = fill();
            break;
          case TRAILER:
            madeProgress = processTrailer();
            break;
          default:
            throw new AssertionError("Invalid state: " + state);
        }
      }
      // If we finished a gzip block, check if we have enough bytes to read another header
      isStalled =
          !madeProgress
              || (state == State.HEADER && gzipMetadataReader.readableBytes() < GZIP_HEADER_MIN_SIZE);
  
      return bytesRead;
    }