public interface DataFrame extends Frame
Disposable.Composite, Disposable.SwapFRAME_TYPE_SHIFT| Modifier and Type | Method and Description |
|---|---|
default String |
getDataAsUtf8()
Returns the data as a UTF-8
String. |
default int |
getDataLength()
Returns the length of the data in the frame.
|
ByteBuf |
getUnsafeData()
Returns the data directly.
|
default <T> T |
mapData(Function<ByteBuf,T> function)
Exposes the data for mapping to a different type.
|
consumeFrame, getFrameType, getUnsafeFrame, mapFramedispose, isDisposeddefault String getDataAsUtf8()
String.Stringdefault int getDataLength()
ByteBuf getUnsafeData()
Note: 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.
getDataAsUtf8(),
mapData(Function)default <T> T mapData(Function<ByteBuf,T> function)
T - the different typefunction - the function to transform the data to a different typeNullPointerException - if function is null