public class FrameHeaderFlyweight 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 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)) |
static int |
FRAME_HEADER_LENGTH |
static int |
FRAME_LENGTH_MASK |
static int |
FRAME_LENGTH_SIZE |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeFrameHeaderLength(FrameType frameType,
Integer metadataLength,
int dataLength) |
static int |
dataLength(ByteBuf byteBuf,
FrameType frameType) |
static int |
dataOffset(ByteBuf byteBuf,
FrameType frameType,
int frameLength) |
static int |
encode(ByteBuf byteBuf,
int streamId,
int flags,
FrameType frameType,
ByteBuf metadata,
ByteBuf data) |
static int |
encodeData(ByteBuf byteBuf,
int dataOffset,
ByteBuf data) |
static int |
encodeFrameHeader(ByteBuf byteBuf,
int frameLength,
int flags,
FrameType frameType,
int streamId) |
static void |
encodeLength(ByteBuf byteBuf,
int offset,
int length) |
static int |
encodeMetadata(ByteBuf byteBuf,
FrameType frameType,
int metadataOffset,
ByteBuf metadata) |
static int |
flags(ByteBuf byteBuf) |
static int |
frameLength(ByteBuf byteBuf) |
static FrameType |
frameType(ByteBuf byteBuf) |
static boolean |
hasMetadataLengthField(FrameType frameType) |
static Integer |
metadataLength(ByteBuf byteBuf,
FrameType frameType,
int frameLength) |
static int |
metadataOffset(ByteBuf byteBuf) |
static int |
payloadLength(ByteBuf byteBuf) |
static ByteBuf |
sliceFrameData(ByteBuf byteBuf) |
static ByteBuf |
sliceFrameMetadata(ByteBuf byteBuf) |
static int |
streamId(ByteBuf byteBuf) |
public static final int FRAME_HEADER_LENGTH
public static final int FRAME_LENGTH_SIZE
public static final int FRAME_LENGTH_MASK
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 int computeFrameHeaderLength(FrameType frameType, @Nullable Integer metadataLength, int dataLength)
public static int encodeFrameHeader(ByteBuf byteBuf, int frameLength, int flags, FrameType frameType, int streamId)
public static int encodeMetadata(ByteBuf byteBuf, FrameType frameType, int metadataOffset, @Nullable ByteBuf metadata)
public static int encode(ByteBuf byteBuf, int streamId, int flags, FrameType frameType, @Nullable ByteBuf metadata, ByteBuf data)
public static int flags(ByteBuf byteBuf)
public static int streamId(ByteBuf byteBuf)
public static int frameLength(ByteBuf byteBuf)
@Nullable public static Integer metadataLength(ByteBuf byteBuf, FrameType frameType, int frameLength)
public static boolean hasMetadataLengthField(FrameType frameType)
public static void encodeLength(ByteBuf byteBuf, int offset, int length)
public static int payloadLength(ByteBuf byteBuf)
public static int metadataOffset(ByteBuf byteBuf)