/** * Creates the {@code REQUEST_CHANNEL} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param follows whether to set the Follows flag * @param complete whether to set the Complete flag * @param initialRequestN the initial requestN * @param metadata the metadata * @param data the data * @return the {@code REQUEST_CHANNEL} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static RequestChannelFrame createRequestChannelFrame( ByteBufAllocator byteBufAllocator, boolean follows, boolean complete, int initialRequestN, @Nullable String metadata, @Nullable String data) { ByteBuf metadataByteBuf = getUtf8AsByteBuf(metadata); ByteBuf dataByteBuf = getUtf8AsByteBuf(data); try { return createRequestChannelFrame( byteBufAllocator, follows, complete, initialRequestN, metadataByteBuf, dataByteBuf); } finally { release(metadataByteBuf); release(dataByteBuf); } }
/** * Creates the {@code REQUEST_CHANNEL} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param follows whether to set the Follows flag * @param complete whether to set the Complete flag * @param initialRequestN the initial requestN * @param metadata the metadata * @param data the data * @return the {@code REQUEST_CHANNEL} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static RequestChannelFrame createRequestChannelFrame( ByteBufAllocator byteBufAllocator, boolean follows, boolean complete, int initialRequestN, @Nullable String metadata, @Nullable String data) { ByteBuf metadataByteBuf = getUtf8AsByteBuf(metadata); ByteBuf dataByteBuf = getUtf8AsByteBuf(data); try { return createRequestChannelFrame( byteBufAllocator, follows, complete, initialRequestN, metadataByteBuf, dataByteBuf); } finally { release(metadataByteBuf); release(dataByteBuf); } }