public final class FrameHeaderCodec extends Object
Not the latest frame layout, but close. Does not include - fragmentation / reassembly - encode should remove Type param and have it as part of method name (1 encode per type?)
Not thread-safe. Assumed to be used single-threaded
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_FRAME_TYPE_CHECK |
static int |
FLAGS_C
(C)omplete: bit to indicate stream completion (
Subscriber.onComplete() ) |
static int |
FLAGS_F
(F)ollows: More fragments follow this fragment (in case of fragmented REQUEST_x or PAYLOAD
frames)
|
static int |
FLAGS_I
(I)gnore flag: a value of 0 indicates the protocol can't ignore this frame
|
static int |
FLAGS_M
(M)etadata flag: a value of 1 indicates the frame contains metadata
|
static int |
FLAGS_N
(N)ext: bit to indicate payload or metadata present (
Subscriber.onNext(Object) ) |
Modifier and Type | Method and Description |
---|---|
static ByteBuf |
encode(ByteBufAllocator allocator,
int streamId,
FrameType frameType,
int flags) |
static void |
ensureFrameType(FrameType frameType,
ByteBuf byteBuf) |
static int |
flags(ByteBuf byteBuf) |
static FrameType |
frameType(ByteBuf byteBuf) |
static boolean |
hasComplete(ByteBuf byteBuf) |
static boolean |
hasFollows(ByteBuf byteBuf) |
static boolean |
hasMetadata(ByteBuf byteBuf) |
static FrameType |
nativeFrameType(ByteBuf byteBuf)
faster version of
frameType(ByteBuf) which does not replace PAYLOAD with synthetic
type |
static int |
size() |
static int |
streamId(ByteBuf byteBuf) |
public static final int FLAGS_I
public static final int FLAGS_M
public static final int FLAGS_F
public static final int FLAGS_C
Subscriber.onComplete()
)public static final int FLAGS_N
Subscriber.onNext(Object)
)public static final String DISABLE_FRAME_TYPE_CHECK
public static ByteBuf encode(ByteBufAllocator allocator, int streamId, FrameType frameType, int flags)
public static boolean hasFollows(ByteBuf byteBuf)
public static boolean hasComplete(ByteBuf byteBuf)
public static int streamId(ByteBuf byteBuf)
public static int flags(ByteBuf byteBuf)
public static boolean hasMetadata(ByteBuf byteBuf)
public static FrameType nativeFrameType(ByteBuf byteBuf)
frameType(ByteBuf)
which does not replace PAYLOAD with synthetic
typepublic static int size()