docs: public static H2HeaderField decodeHeader(WsByteBuffer buffer, H2HeaderTable table, boolean isFirstHeader,
                                               boolean isTrailerBlock, H2ConnectionSettings settings) throws CompressionException {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.entry(tc, "decodeHeader");
          }
  
          if (!table.isDynamicTableValid()) {
              throw new CompressionException("The context for this dynamic table is not valid.");
          }
  
          if (buffer == null || !buffer.hasRemaining()) {
              throw new CompressionException("Invalid attempt to decode empty or null buffer.");
          }
  
          //Get first byte for header being decoded
          byte currentByte = buffer.get();
          buffer.position(buffer.position() - 1);
          //Format this instruction byte so that 4 LSB are set to '1',
          //allowing for quick assessment of what instruction this byte
          //contains.
          byte maskedByte = HpackUtils.format(currentByte, HpackConstants.MASK_0F);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Operation Byte: " + HpackUtils.byteToHexString(currentByte));
          }
  
          int decodedInteger = 0;
          H2HeaderField header = null;
  
          //If the MSB is 1, the masked byte will be negative since this is
          //a signed byte.
          if (maskedByte < HpackConstants.MASK_00) {
  
              //Check against the byte '1000000' as the index value of 0
              //for indexed headers is not used and MUST be treated as a
              //decoding error.
              if (currentByte == HpackConstants.MASK_80) {
                  throw new CompressionException("An indexed header cannot have an index of 0");
              }
              //Look for the corresponding integer representation - each byte for
              //the integer representation decoder, for this case, has N = 7.
  
              decodedInteger = IntegerRepresentation.decode(buffer, ByteFormatType.INDEXED);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Operation byte indicated header is already indexed at index location: " + decodedInteger +
                               ". Searching table...");
              }
  
              //Get both header name and value using the given index location.
  
              header = table.getHeaderEntry(decodedInteger);
  
              if (header == null) {
                  throw new CompressionException("Received an invalid header index");
              }
              checkIsValidH2Header(header, isTrailerBlock);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Found header: [" + header.getName() + ", " + header.getValue() + "]");
              }
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.exit(tc, "decodeHeader");
              }
              return header;
          }
  
          //Not currently index - verify literal index type and handle
          //accordingly. There are three types of possible encodings for a <HeaderField>.
          //Bits 7, 6, and 5 will tell us what type of encoding this is. There is
          //also the possibility of a table update command.
          else {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Header not fully indexed in table, determining indexing type.");
              }
  
              /*
               * If bit 7 is '1', then this LiteralIndexType.INCREMENTAL
               *
               * Literal Header Field with Incremental Indexing
               * +---+---+---+---+---+---+---+---+
               * | 0 | 1 | Index (6+) ---------- |
               * +---+---+-----------------------+
               */
              if (maskedByte >= HpackConstants.MASK_4F) {
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Indexing decode type: INCREMENTAL");
                  }
  
                  header = decodeHeader(buffer, table, ByteFormatType.INCREMENTAL);
  
              } else if (maskedByte >= HpackConstants.MASK_2F) {
                  if (!isFirstHeader) {
                      throw new CompressionException("dynamic table size update must occur at the beginning of the first header block");
                  }
  
                  int fragmentLength = IntegerRepresentation.decode(buffer, ByteFormatType.TABLE_UPDATE);
                  if (settings != null && fragmentLength > settings.getHeaderTableSize()) {
                      throw new CompressionException("dynamic table size update size was larger than SETTINGS_HEADER_TABLE_SIZE");
                  }
                  table.updateTableSize(fragmentLength);
  
                  return null;
              }
  
              /*
               * Bit 7 is '0' & bits 6-5 match '01', then this is
               * LiteralIndexType.NEVERINDEX
               */
              else if (maskedByte == HpackConstants.MASK_1F) {
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Indexing decode type: NEVERINDEX");
                  }
  
                  header = decodeHeader(buffer, table, ByteFormatType.NEVERINDEX);
  
              }
  
              /*
               * Bit 7 is '0' & bits 6-5 match '00', then this is
               * LiteralIndexType.NOINDEXING
               */
              else if (maskedByte == HpackConstants.MASK_0F) {
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Indexing decode type: NOINDEXING");
                  }
  
                  header = decodeHeader(buffer, table, ByteFormatType.NOINDEXING);
  
              }
  
          }
  
          checkIsValidH2Header(header, isTrailerBlock);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Decoded the header: [" + header.getName() + ", " + header.getValue() + "]");
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.exit(tc, "decodeHeader");
          }
  
          return header;
  
      }