Top Description Fields Constructors Methods
io.rsocket.frame

public final Class FrameHeaderCodec

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, org.reactivestreams.Subscriber

Per connection frame flyweight.

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

Field Summary

Modifier and TypeField and Description
public static final String
private static boolean
public static final int
FLAGS_C

(C)omplete: bit to indicate stream completion (Subscriber#onComplete())

public static final int
FLAGS_F

(F)ollows: More fragments follow this fragment (in case of fragmented REQUEST_x or PAYLOAD frames)

public static final int
FLAGS_I

(I)gnore flag: a value of 0 indicates the protocol can't ignore this frame

public static final int
FLAGS_M

(M)etadata flag: a value of 1 indicates the frame contains metadata

public static final int
FLAGS_N

(N)ext: bit to indicate payload or metadata present (Subscriber#onNext(Object))

private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ByteBuf
encode(final ByteBufAllocator allocator, final int streamId, final FrameType frameType, int flags)

pack-priv static ByteBuf
encodeStreamZero(final ByteBufAllocator allocator, final FrameType frameType, int flags)

public static void
ensureFrameType(final FrameType frameType, ByteBuf byteBuf)

public static int
flags(final ByteBuf byteBuf)

public static FrameType
frameType(ByteBuf byteBuf)

public static boolean
public static boolean
public static boolean
public static FrameType
nativeFrameType(ByteBuf byteBuf)

faster version of frameType(ByteBuf) which does not replace PAYLOAD with synthetic type

public static int
size()

public static int
streamId(ByteBuf byteBuf)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DISABLE_FRAME_TYPE_CHECKback to summary
public static final String DISABLE_FRAME_TYPE_CHECK
disableFrameTypeCheckback to summary
private static boolean disableFrameTypeCheck
FLAGS_Cback to summary
public static final int FLAGS_C

(C)omplete: bit to indicate stream completion (Subscriber#onComplete())

FLAGS_Fback to summary
public static final int FLAGS_F

(F)ollows: More fragments follow this fragment (in case of fragmented REQUEST_x or PAYLOAD frames)

FLAGS_Iback to summary
public static final int FLAGS_I

(I)gnore flag: a value of 0 indicates the protocol can't ignore this frame

FLAGS_Mback to summary
public static final int FLAGS_M

(M)etadata flag: a value of 1 indicates the frame contains metadata

FLAGS_Nback to summary
public static final int FLAGS_N

(N)ext: bit to indicate payload or metadata present (Subscriber#onNext(Object))

FRAME_FLAGS_MASKback to summary
private static final int FRAME_FLAGS_MASK
FRAME_TYPE_BITSback to summary
private static final int FRAME_TYPE_BITS
FRAME_TYPE_SHIFTback to summary
private static final int FRAME_TYPE_SHIFT
HEADER_SIZEback to summary
private static final int HEADER_SIZE

Constructor Detail

FrameHeaderCodecback to summary
private FrameHeaderCodec()

Method Detail

encodeback to summary
public static ByteBuf encode(final ByteBufAllocator allocator, final int streamId, final FrameType frameType, int flags)
encodeStreamZeroback to summary
pack-priv static ByteBuf encodeStreamZero(final ByteBufAllocator allocator, final FrameType frameType, int flags)
ensureFrameTypeback to summary
public static void ensureFrameType(final FrameType frameType, ByteBuf byteBuf)
flagsback to summary
public static int flags(final ByteBuf byteBuf)
frameTypeback to summary
public static FrameType frameType(ByteBuf byteBuf)
hasCompleteback to summary
public static boolean hasComplete(ByteBuf byteBuf)
hasFollowsback to summary
public static boolean hasFollows(ByteBuf byteBuf)
hasMetadataback to summary
public static boolean hasMetadata(ByteBuf byteBuf)
nativeFrameTypeback to summary
public static FrameType nativeFrameType(ByteBuf byteBuf)

faster version of frameType(ByteBuf) which does not replace PAYLOAD with synthetic type

sizeback to summary
public static int size()
streamIdback to summary
public static int streamId(ByteBuf byteBuf)