com.hazelcast.nio.serialization
Class Data

java.lang.Object
  extended by com.hazelcast.nio.serialization.Data
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public final class Data
extends Object
implements IdentifiedDataSerializable


Field Summary
static int FACTORY_ID
           
static int ID
           
static int NO_CLASS_ID
           
 
Constructor Summary
Data()
           
Data(int type, byte[] bytes)
           
 
Method Summary
 int bufferSize()
           
 boolean equals(Object obj)
           
 byte[] getBuffer()
           
 ClassDefinition getClassDefinition()
           
 int getFactoryId()
           
 int getHeapCost()
           
 int getId()
           
 int getPartitionHash()
           
 int getType()
           
 int hashCode()
           
 boolean isDataSerializable()
           
 boolean isPortable()
           
 void postConstruct(SerializationContext context)
           
 void readData(com.hazelcast.nio.ObjectDataInput in)
          WARNING:

Should be in sync with DataAdapter.readFrom(java.nio.ByteBuffer)

 String toString()
           
 int totalSize()
          Calculates the size of the binary after the Data is serialized.
 void writeData(com.hazelcast.nio.ObjectDataOutput out)
          WARNING:

Should be in sync with DataAdapter.writeTo(java.nio.ByteBuffer)

totalSize() should be updated whenever writeData method is changed.

 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FACTORY_ID

public static final int FACTORY_ID
See Also:
Constant Field Values

ID

public static final int ID
See Also:
Constant Field Values

NO_CLASS_ID

public static final int NO_CLASS_ID
See Also:
Constant Field Values
Constructor Detail

Data

public Data()

Data

public Data(int type,
            byte[] bytes)
Method Detail

postConstruct

public void postConstruct(SerializationContext context)

readData

public void readData(com.hazelcast.nio.ObjectDataInput in)
              throws IOException
WARNING:

Should be in sync with DataAdapter.readFrom(java.nio.ByteBuffer)

Specified by:
readData in interface DataSerializable
Throws:
IOException

writeData

public void writeData(com.hazelcast.nio.ObjectDataOutput out)
               throws IOException
WARNING:

Should be in sync with DataAdapter.writeTo(java.nio.ByteBuffer)

totalSize() should be updated whenever writeData method is changed.

Specified by:
writeData in interface DataSerializable
Throws:
IOException

bufferSize

public int bufferSize()

totalSize

public int totalSize()
Calculates the size of the binary after the Data is serialized.

WARNING:

Should be in sync with writeData(com.hazelcast.nio.ObjectDataOutput)


getHeapCost

public int getHeapCost()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getPartitionHash

public int getPartitionHash()

getType

public int getType()

getClassDefinition

public ClassDefinition getClassDefinition()

getBuffer

public byte[] getBuffer()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getFactoryId

public int getFactoryId()
Specified by:
getFactoryId in interface IdentifiedDataSerializable

getId

public int getId()
Specified by:
getId in interface IdentifiedDataSerializable

isPortable

public boolean isPortable()

isDataSerializable

public boolean isDataSerializable()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.