code: public static void writeHttp2Headers(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder,
                                           HttpResponseFuture outboundRespStatusFuture, int streamId,
                                           Http2Headers http2Headers, boolean endStream) throws Http2Exception {
          ChannelFuture channelFuture = encoder.writeHeaders(
                  ctx, streamId, http2Headers, 0, endStream, ctx.newPromise());
          encoder.flowController().writePendingBytes();
          ctx.flush();
          Util.addResponseWriteFailureListener(outboundRespStatusFuture, channelFuture);
      }
docs: Writes HTTP2 headers to outbound response.
  
  @param ctx                      the channel handler context
  @param encoder                  the HTTP2 connection encoder
  @param outboundRespStatusFuture the future of outbound response write operation
  @param streamId                 the id of the stream
  @param http2Headers             the Http2Headers received over a HTTP/2 stream
  @param endStream                is this the end of stream
  @throws Http2Exception throws if a protocol-related error occurred