code: public static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders,
              HttpVersion httpVersion, boolean isTrailer, boolean isRequest) throws Http2Exception {
          Http2ToHttpHeaderTranslator translator = new Http2ToHttpHeaderTranslator(streamId, outputHeaders, isRequest);
          try {
              for (Entry<CharSequence, CharSequence> entry : inputHeaders) {
                  translator.translate(entry);
              }
          } catch (Http2Exception ex) {
              throw ex;
          } catch (Throwable t) {
              throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error");
          }
  
          outputHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING);
          outputHeaders.remove(HttpHeaderNames.TRAILER);
          if (!isTrailer) {
              outputHeaders.setInt(ExtensionHeaderNames.STREAM_ID.text(), streamId);
              HttpUtil.setKeepAlive(outputHeaders, httpVersion, true);
          }
      }
docs: Translate and add HTTP/2 headers to HTTP/1.x headers.
  
  @param streamId The stream associated with {@code sourceHeaders}.
  @param inputHeaders The HTTP/2 headers to convert.
  @param outputHeaders The object which will contain the resulting HTTP/1.x headers..
  @param httpVersion What HTTP/1.x version {@code outputHeaders} should be treated as when doing the conversion.
  @param isTrailer {@code true} if {@code outputHeaders} should be treated as trailing headers.
  {@code false} otherwise.
  @param isRequest {@code true} if the {@code outputHeaders} will be used in a request message.
  {@code false} for response message.
  @throws Http2Exception If not all HTTP/2 headers can be translated to HTTP/1.x.