docs: public byte[] buildHeader(HeaderFieldType xIndexingType, String xHeaderName, String xHeaderValue, long xHeaderIndex) {
  
          byte headerStaticIndex = -1;
          byte[] retArray = null;
          LongEncoder enc = new LongEncoder();
  
          if (xHeaderName != null) {
              headerStaticIndex = utils.getIndexNumber(xHeaderName);
          }
  
          if (xIndexingType == HeaderFieldType.INDEXED) {
              if (headerStaticIndex != -1) {
                  // one of the headers defined in the spec static table
                  retArray = new byte[1];
                  retArray[0] = (byte) (0x80 | headerStaticIndex);
              } else {
                  // user passed in the headerIndex that we are to use
                  retArray = enc.encode(xHeaderIndex, 7);
                  retArray[0] = (byte) (0x80 | retArray[0]);
              }
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Indexed header built array: " + utils.printArray(retArray));
              }
              return retArray;
          }
  
          if ((xIndexingType == HeaderFieldType.LITERAL_INCREMENTAL_INDEXING)
              || (xIndexingType == HeaderFieldType.LITERAL_NEVER_INDEXED_INDEXED_NAME)
              || (xIndexingType == HeaderFieldType.LITERAL_WITHOUT_INDEXING_AND_INDEXED_NAME)) {
  
              byte[] idxArray = null;
  
              if (xHeaderName != null) {
                  headerStaticIndex = utils.getIndexNumber(xHeaderName);
              }
  
              // user passed in the headerIndex that we are to use
              if (xIndexingType == HeaderFieldType.LITERAL_INCREMENTAL_INDEXING) {
                  idxArray = enc.encode(headerStaticIndex, 6);
                  // set first two bits to "01"
                  idxArray[0] = (byte) (0x40 | idxArray[0]);
                  idxArray[0] = (byte) (0x7F & idxArray[0]);
              } else if (xIndexingType == HeaderFieldType.LITERAL_NEVER_INDEXED_INDEXED_NAME) {
                  idxArray = enc.encode(headerStaticIndex, 4);
                  // set first four bits to "0001"
                  idxArray[0] = (byte) (0x10 | idxArray[0]);
                  idxArray[0] = (byte) (0x1F & idxArray[0]);
              } else if ((xIndexingType == HeaderFieldType.LITERAL_WITHOUT_INDEXING_AND_INDEXED_NAME)) {
                  idxArray = enc.encode(headerStaticIndex, 4);
                  // set first four bits to "0000"
                  idxArray[0] = (byte) (0x0F & idxArray[0]);
              }
  
              byte[] ba = xHeaderValue.getBytes(); // may need to deal with string encoding later
              byte[] hArrayValue = HuffmanEncoder.convertAsciiToHuffman(ba);
  
              byte[] hArrayLength = enc.encode(hArrayValue.length, 7);
              hArrayLength[0] = (byte) (0x80 | hArrayLength[0]);
  
              int totalLength = idxArray.length + hArrayLength.length + hArrayValue.length;
  
              retArray = new byte[totalLength];
  
              System.arraycopy(idxArray, 0, retArray, 0, idxArray.length);
              System.arraycopy(hArrayLength, 0, retArray, idxArray.length, hArrayLength.length);
              System.arraycopy(hArrayValue, 0, retArray, idxArray.length + hArrayLength.length, hArrayValue.length);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Literal Header Field with Incremental Indexing built array: " + utils.printArray(retArray));
              }
              return retArray;
  
          }
  
          if ((xIndexingType == HeaderFieldType.LITERAL_WITHOUT_INDEXING_AND_NEW_NAME) ||
              (xIndexingType == HeaderFieldType.LITERAL_NEVER_INDEXED_NEW_NAME) ||
              (xIndexingType == HeaderFieldType.LITERAL_INCREMENTAL_INDEXING_NEW_NAME)) {
  
              byte[] ba = xHeaderName.getBytes(); // may need to deal with string encoding later
              byte[] hName = HuffmanEncoder.convertAsciiToHuffman(ba);
              byte[] hNameLength = enc.encode(hName.length, 7);
              hNameLength[0] = (byte) (0x80 | hNameLength[0]);
  
              ba = xHeaderValue.getBytes(); // may need to deal with string encoding later
              byte[] hValue = HuffmanEncoder.convertAsciiToHuffman(ba);
              byte[] hValueLength = enc.encode(hValue.length, 7);
              hValueLength[0] = (byte) (0x80 | hValueLength[0]);
  
              int totalLength = 1 + hNameLength.length + hName.length + hValueLength.length + hValue.length;
  
              retArray = new byte[totalLength];
  
              if (xIndexingType == HeaderFieldType.LITERAL_WITHOUT_INDEXING_AND_NEW_NAME) {
                  retArray[0] = 0x00;
              } else if (xIndexingType == HeaderFieldType.LITERAL_NEVER_INDEXED_NEW_NAME) {
                  retArray[0] = 0x10;
              } else if (xIndexingType == HeaderFieldType.LITERAL_INCREMENTAL_INDEXING_NEW_NAME) {
                  retArray[0] = 0x40;
              }
  
              System.arraycopy(hNameLength, 0, retArray, 1, hNameLength.length);
              System.arraycopy(hName, 0, retArray, 1 + hNameLength.length, hName.length);
              System.arraycopy(hValueLength, 0, retArray, 1 + hNameLength.length + hName.length, hValueLength.length);
              System.arraycopy(hValue, 0, retArray, 1 + hNameLength.length + hName.length + hValueLength.length, hValue.length);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Literal Header Field without Indexing - new Name built array: "
                               + utils.printArray(retArray));
              }
              return retArray;
          }
  
          return null;
      }