com.esotericsoftware.kryo
Interface CustomSerialization


public interface CustomSerialization

Allows implementing classes to perform their own serialization. Custom serialization can be more efficient in some cases.

Custom serialization can make use of any Serializer needed. Eg:

public void writeObjectData (ByteBuffer buffer) {
    StringSerializer.put(stringValue, buffer);
    fieldSerializerInstance.writeObjectData(context, buffer, someOtherClassValue);
    buffer.putInt(intValue);
}

public void readObjectData (ByteBuffer buffer) {
    stringValue = StringSerializer.get(buffer);
    someOtherClassValue = fieldSerializerInstance.readObjectData(context, buffer, SomeOtherClass.class);
    intValue = buffer.getInt();
}

Author:
Nathan Sweet
See Also:
CustomSerializer

Method Summary
 void readObjectData(Kryo kryo, java.nio.ByteBuffer buffer)
           
 void writeObjectData(Kryo kryo, java.nio.ByteBuffer buffer)
           
 

Method Detail

writeObjectData

void writeObjectData(Kryo kryo,
                     java.nio.ByteBuffer buffer)

readObjectData

void readObjectData(Kryo kryo,
                    java.nio.ByteBuffer buffer)


Copyright © 2011. All Rights Reserved.