public abstract class PayloadUtils extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Create a Payload with data only.
Create a Payload from the given metadata and data.
Use this method to slice, retain and wrap the data portion of the
public static DataBuffer retainDataAndReleasePayload(Payload payload, DataBufferFactory bufferFactory)
Payload, and also to release the
Payload. This assumes the Payload metadata has been read by now and ensures downstream code need only be aware of
payload- the payload to process
bufferFactory- the DataBufferFactory to wrap with
public static Payload createPayload(DataBuffer data, DataBuffer metadata)
If at least one is
is created with either obtaining the underlying native
Unpooled.wrappedBuffer(ByteBuffer...) if necessary.
Otherwise, if both are
DefaultPayload is created.
data- the data part for the payload
metadata- the metadata part for the payload