public final class PayloadFrame extends Object
PAYLOAD frame.Disposable.Composite, Disposable.SwapFRAME_TYPE_SHIFT| Modifier and Type | Method and Description |
|---|---|
PayloadFrame |
createFragment(ByteBufAllocator byteBufAllocator,
ByteBuf metadata,
ByteBuf data)
Generates the fragment for this frame.
|
PayloadFrame |
createNonFragment(ByteBufAllocator byteBufAllocator,
ByteBuf metadata,
ByteBuf data)
Generates the non-fragment for this frame.
|
static PayloadFrame |
createPayloadFrame(ByteBuf byteBuf)
Creates the
PAYLOAD frame. |
static PayloadFrame |
createPayloadFrame(ByteBufAllocator byteBufAllocator,
boolean follows,
boolean complete,
ByteBuf metadata,
ByteBuf data)
Creates the
PAYLOAD frame. |
static PayloadFrame |
createPayloadFrame(ByteBufAllocator byteBufAllocator,
boolean follows,
boolean complete,
String metadata,
String data)
Creates the
PAYLOAD frame. |
void |
dispose() |
boolean |
equals(Object o) |
FrameType |
getFrameType()
Returns the
FrameType. |
ByteBuf |
getUnsafeData()
Returns the data directly.
|
ByteBuf |
getUnsafeFrame()
Returns the frame directly.
|
ByteBuf |
getUnsafeMetadata()
Returns the metadata directly.
|
int |
hashCode() |
boolean |
isCompleteFlagSet()
Returns whether the Complete flag is set.
|
boolean |
isFollowsFlagSet()
Returns whether the Follows flag is set.
|
boolean |
isNextFlagSet()
Returns whether the Next flag is set.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMetadataAsUtf8, getMetadataLength, getUnsafeMetadataAsUtf8, getUnsafeMetadataLength, mapMetadatagetDataAsUtf8, getDataLength, mapDataconsumeFrame, getFrameType, getUnsafeFrame, mapFramedispose, isDisposedpublic static PayloadFrame createPayloadFrame(ByteBuf byteBuf)
PAYLOAD frame.byteBuf - the ByteBuf representing the framePAYLOAD frame.NullPointerException - if byteBuf is nullpublic static PayloadFrame createPayloadFrame(ByteBufAllocator byteBufAllocator, boolean follows, boolean complete, @Nullable String metadata, @Nullable String data)
PAYLOAD frame.byteBufAllocator - the ByteBufAllocator to usefollows - whether to set the Follows flagcomplete - respond whether to set the Complete flagmetadata - the metadatadata - the dataPAYLOAD frameNullPointerException - if byteBufAllocator is nullpublic static PayloadFrame createPayloadFrame(ByteBufAllocator byteBufAllocator, boolean follows, boolean complete, @Nullable ByteBuf metadata, @Nullable ByteBuf data)
PAYLOAD frame.byteBufAllocator - the ByteBufAllocator to usefollows - respond whether to set the Follows flagcomplete - respond whether to set the Complete flagmetadata - the metadatadata - the dataPAYLOAD frameNullPointerException - if byteBufAllocator is nullpublic PayloadFrame createFragment(ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data)
FragmentableFramebyteBufAllocator - the ByteBufAllocator to usemetadata - the metadatadata - the datapublic PayloadFrame createNonFragment(ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data)
FragmentableFramebyteBufAllocator - the ByteBufAllocator to usemetadata - the metadatadata - the datapublic ByteBuf getUnsafeData()
DataFrameNote: this data will be outside of the Frame's lifecycle and may be released
at any time. It is highly recommended that you ByteBuf.retain() the data if you store
it.
DataFrame.getDataAsUtf8(),
DataFrame.mapData(Function)@Nullable public ByteBuf getUnsafeMetadata()
MetadataFramenull.
Note: this metadata will be outside of the Frame's lifecycle and may be
released at any time. It is highly recommended that you ByteBuf.retain() the metadata
if you store it.
null if the Metadata flag is not setMetadataFrame.getMetadataAsUtf8(),
MetadataFrame.mapMetadata(Function)public boolean isCompleteFlagSet()
public boolean isNextFlagSet()
public final boolean isFollowsFlagSet()
FragmentableFrameisFollowsFlagSet in interface FragmentableFramepublic 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)