public final class DefaultData extends Object
| Constructor and Description |
|---|
DefaultData() |
DefaultData(int type,
byte[] data) |
DefaultData(int type,
byte[] data,
int partitionHash) |
DefaultData(int type,
byte[] data,
int partitionHash,
byte[] header) |
| Modifier and Type | Method and Description |
|---|---|
int |
dataSize()
Returns size of binary data
|
boolean |
equals(Object o) |
byte[] |
getData()
Returns byte array representation of internal binary format.
|
byte[] |
getHeader()
Returns byte array representation of header.
|
int |
getHeapCost()
Returns approximate heap cost of this Data object in bytes.
|
int |
getPartitionHash()
Returns partition hash calculated for serialized object.
|
int |
getType()
Returns serialization type of binary form.
|
long |
hash64()
Returns 64-bit hash code for this Data object.
|
int |
hashCode() |
boolean |
hasPartitionHash()
Returns true if Data has partition hash, false otherwise.
|
int |
headerSize()
Returns size of header.
|
boolean |
isPortable()
Returns true if this Data is created from a
Portable object,
false otherwise. |
int |
readIntHeader(int offset,
ByteOrder order)
Reads an integer header from given offset using given ByteOrder.
|
void |
setData(byte[] array) |
void |
setHeader(byte[] header) |
void |
setPartitionHash(int partitionHash) |
void |
setType(int type) |
String |
toString() |
public DefaultData()
public DefaultData(int type,
byte[] data)
public DefaultData(int type,
byte[] data,
int partitionHash)
public DefaultData(int type,
byte[] data,
int partitionHash,
byte[] header)
public int dataSize()
Datapublic int getPartitionHash()
DataPartitioningStrategy during serialization.
If partition hash is not set then standard hashCode() is used.PartitionAware,
PartitioningStrategy,
SerializationService.toData(Object, com.hazelcast.core.PartitioningStrategy)public boolean hasPartitionHash()
Datapublic int headerSize()
Datapublic byte[] getHeader()
Datapublic byte[] getData()
Datapublic void setData(byte[] array)
public void setPartitionHash(int partitionHash)
public int getType()
DataSerializer.getTypeId()public void setType(int type)
public void setHeader(byte[] header)
public int readIntHeader(int offset,
ByteOrder order)
Dataoffset - offset of integer headerorder - byte orderpublic int getHeapCost()
Datapublic long hash64()
Datapublic boolean isPortable()
DataPortable object,
false otherwise.Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.