@InterfaceAudience.Public public final class UserPayload extends Object
Modifier and Type | Method and Description |
---|---|
static UserPayload |
create(ByteBuffer payload)
Create a UserPayload instance which encapsulates a
ByteBuffer . |
static UserPayload |
create(ByteBuffer payload,
int version)
Create an explicitly versioned UserPayload instance which encapsulates a
ByteBuffer . |
byte[] |
deepCopyAsArray() |
ByteBuffer |
getPayload()
Return the payload as a read-only ByteBuffer.
|
int |
getVersion() |
boolean |
hasPayload() |
public static UserPayload create(@Nullable ByteBuffer payload)
ByteBuffer
. The version number used will be 0payload
- the ByteBuffer
payloadUserPayload
public static UserPayload create(@Nullable ByteBuffer payload, int version)
ByteBuffer
.payload
- the ByteBuffer
payloadUserPayload
@Nullable public ByteBuffer getPayload()
public int getVersion()
public boolean hasPayload()
@InterfaceStability.Unstable public byte[] deepCopyAsArray()
Copyright © 2015 Apache Software Foundation. All rights reserved.