code: public static void writeHttp2Promise(Http2PushPromise pushPromise, ChannelHandlerContext ctx, Http2Connection conn,
                                           Http2ConnectionEncoder encoder, HttpCarbonMessage inboundRequestMsg,
                                           HttpResponseFuture outboundRespStatusFuture,
                                           int originalStreamId) throws Http2Exception {
          int promisedStreamId = getNextStreamId(conn);
          // Update streamIds
          pushPromise.setPromisedStreamId(promisedStreamId);
          pushPromise.setStreamId(originalStreamId);
          // Construct http request
          HttpRequest httpRequest = pushPromise.getHttpRequest();
          httpRequest.headers().add(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text(), HTTP_SCHEME);
          // A push promise is a server initiated request, hence it should contain request headers
          Http2Headers http2Headers =
                  HttpConversionUtil.toHttp2Headers(httpRequest, true);
          // Write the push promise to the wire
          ChannelFuture channelFuture = encoder.writePushPromise(
                  ctx, originalStreamId, promisedStreamId, http2Headers, 0, ctx.newPromise());
          encoder.flowController().writePendingBytes();
          ctx.flush();
          Util.checkForResponseWriteStatus(inboundRequestMsg, outboundRespStatusFuture, channelFuture);
      }
docs: Writes an HTTP2 promise.
  
  @param pushPromise              HTTP/2 promise message
  @param ctx                      the channel handler context
  @param conn                     HTTP2 connection
  @param encoder                  the HTTP2 connection encoder
  @param inboundRequestMsg        request message received from the client
  @param outboundRespStatusFuture the future of outbound response write operation
  @param originalStreamId         the original id of the stream
  @throws Http2Exception throws if a protocol-related error occurred