public final class FrameLengthFrame extends Object
Disposable.Composite, Disposable.SwapFRAME_TYPE_SHIFT| Modifier and Type | Method and Description |
|---|---|
static FrameLengthFrame |
createFrameLengthFrame(ByteBuf byteBuf)
Creates the frame with a frame length.
|
static FrameLengthFrame |
createFrameLengthFrame(ByteBufAllocator byteBufAllocator,
Frame frame)
Creates the frame with a frame length.
|
void |
dispose() |
boolean |
equals(Object o) |
int |
getFrameLength()
Returns the frame length.
|
FrameType |
getFrameType()
Returns the
FrameType. |
ByteBuf |
getUnsafeFrame()
Returns the frame directly.
|
ByteBuf |
getUnsafeFrameWithoutFrameLength()
Returns the frame without frame length directly.
|
int |
hashCode() |
<T> T |
mapFrameWithoutFrameLength(Function<ByteBuf,T> function)
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitconsumeFrame, mapFrameisDisposedpublic static FrameLengthFrame createFrameLengthFrame(ByteBuf byteBuf)
byteBuf - the ByteBuf representing the frameNullPointerException - if byteBuf is nullpublic static FrameLengthFrame createFrameLengthFrame(ByteBufAllocator byteBufAllocator, Frame frame)
byteBufAllocator - the ByteBufAllocator to useframe - the frame to prepend the frame length toNullPointerException - if byteBufAllocator or frame is nullpublic int getFrameLength()
public ByteBuf getUnsafeFrameWithoutFrameLength()
Note: this frame without frame length 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 without frame length if you store it.
mapFrameWithoutFrameLength(Function)public <T> T mapFrameWithoutFrameLength(Function<ByteBuf,T> function)
T - the different typefunction - the function to transform the Frame without the frame length as a
ByteBuf to a different typeFrame without the frame length as a ByteBuf mapped to a different
typeNullPointerException - if function is nullpublic final void dispose()
dispose in interface Disposablepublic FrameType getFrameType()
FrameFrameType.getFrameType in interface FrameFrameTypepublic final ByteBuf getUnsafeFrame()
FrameNote: 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.
getUnsafeFrame in interface FrameFrame.consumeFrame(Consumer),
Frame.mapFrame(Function)