public interface Frame extends Disposable
Disposable.Composite, Disposable.Swap| Modifier and Type | Field and Description |
|---|---|
static int |
FRAME_TYPE_SHIFT
The shift length for the frame type.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
consumeFrame(Consumer<ByteBuf> consumer)
Exposes the
Frame as a ByteBuf for consumption. |
FrameType |
getFrameType()
Returns the
FrameType. |
ByteBuf |
getUnsafeFrame()
Returns the frame directly.
|
default <T> T |
mapFrame(Function<ByteBuf,T> function)
Exposes the
Frame as a ByteBuf for mapping to a different type. |
dispose, isDisposedstatic final int FRAME_TYPE_SHIFT
default void consumeFrame(Consumer<ByteBuf> consumer)
Frame as a ByteBuf for consumption.consumer - the Consumer to consume the Frame as a ByteBufNullPointerException - if consumer is nullByteBuf getUnsafeFrame()
Note: this frame will be outside of the Frame's lifecycle and may be released
at any time. It is highly recommended that you ByteBuf.retain() the frame if you store
it.
consumeFrame(Consumer),
mapFrame(Function)default <T> T mapFrame(Function<ByteBuf,T> function)
Frame as a ByteBuf for mapping to a different type.T - the different typefunction - the Function to transform the Frame as a ByteBuf to a
different typeFrame as a ByteBuf mapped to a different typeNullPointerException - if function is null