RequestNFrameCodec { public static ByteBuf encode( final ByteBufAllocator allocator, final int streamId, long requestN) { if (requestN < 1) { throw new IllegalArgumentException("request n is less than 1"); } int reqN = requestN > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) requestN; ByteBuf header = FrameHeaderCodec.encode(allocator, streamId, FrameType.REQUEST_N, 0); return header.writeInt(reqN); } private  RequestNFrameCodec(); static ByteBuf encode(
      final ByteBufAllocator allocator, final int streamId, long requestN); static long requestN(ByteBuf byteBuf);  }
@Test void testEncoding() { ByteBuf frame = RequestNFrameCodec.encode(ByteBufAllocator.DEFAULT, 1, 5); frame = FrameLengthCodec.encode(ByteBufAllocator.DEFAULT, frame.readableBytes(), frame); assertEquals("00000a00000001200000000005", ByteBufUtil.hexDump(frame)); frame.release(); }