public final class Packet extends HeapData implements OutboundFrame
| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_BIND |
static int |
HEADER_EVENT |
static int |
HEADER_OP |
static int |
HEADER_RESPONSE |
static int |
HEADER_URGENT |
static int |
HEADER_WAN_REPLICATION |
static byte |
VERSION |
DATA_OFFSET, HEAP_DATA_OVERHEAD, PARTITION_HASH_OFFSET, payload, TYPE_OFFSET| Constructor and Description |
|---|
Packet() |
Packet(byte[] payload) |
Packet(byte[] payload,
int partitionId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
done() |
boolean |
equals(Object o) |
Connection |
getConn()
Gets the Connection this Packet was send with.
|
short |
getHeader()
Returns the header of the Packet.
|
int |
getPartitionId()
Returns the partition id of this packet.
|
int |
hashCode() |
boolean |
isHeaderSet(int bit) |
boolean |
isUrgent()
Checks if this Frame is urgent.
|
int |
packetSize()
Returns an estimation of the packet, including its payload, in bytes.
|
boolean |
readFrom(ByteBuffer src) |
void |
reset() |
void |
setConn(Connection conn)
Sets the Connection this Packet is send with.
|
void |
setHeader(int bit) |
String |
toString() |
boolean |
writeTo(ByteBuffer dst) |
dataSize, getHeapCost, getPartitionHash, getType, hash64, hasPartitionHash, isPortable, toByteArray, totalSizepublic static final byte VERSION
public static final int HEADER_OP
public static final int HEADER_RESPONSE
public static final int HEADER_EVENT
public static final int HEADER_WAN_REPLICATION
public static final int HEADER_URGENT
public static final int HEADER_BIND
public Packet()
public Packet(byte[] payload)
public Packet(byte[] payload,
int partitionId)
public Connection getConn()
public void setConn(Connection conn)
conn - the connection.public void setHeader(int bit)
public boolean isHeaderSet(int bit)
public short getHeader()
public int getPartitionId()
public boolean isUrgent()
OutboundFrameisUrgent in interface OutboundFramepublic boolean writeTo(ByteBuffer dst)
public boolean readFrom(ByteBuffer src)
public int packetSize()
public boolean done()
public void reset()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.