de.javakaffee.kryoserializers
Class SynchronizedCollectionsSerializer

java.lang.Object
  extended by com.esotericsoftware.kryo.Serializer
      extended by de.javakaffee.kryoserializers.SynchronizedCollectionsSerializer

public class SynchronizedCollectionsSerializer
extends com.esotericsoftware.kryo.Serializer

A kryo Serializer for synchronized Collections and Maps created via Collections.

Author:
Martin Grotzke

Constructor Summary
SynchronizedCollectionsSerializer(com.esotericsoftware.kryo.Kryo kryo)
           
 
Method Summary
<T> T
readObjectData(ByteBuffer buffer, Class<T> clazz)
          
static void registerSerializers(com.esotericsoftware.kryo.Kryo kryo)
          Creates a new SynchronizedCollectionsSerializer and registers its serializer for the several synchronized Collections that can be created via Collections, including Maps.
 void writeObjectData(ByteBuffer buffer, Object object)
          
 
Methods inherited from class com.esotericsoftware.kryo.Serializer
isFinal, newInstance, readObject, setCanBeNull, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizedCollectionsSerializer

public SynchronizedCollectionsSerializer(com.esotericsoftware.kryo.Kryo kryo)
Parameters:
kryo - the kryo instance
Method Detail

readObjectData

public <T> T readObjectData(ByteBuffer buffer,
                            Class<T> clazz)

Specified by:
readObjectData in class com.esotericsoftware.kryo.Serializer

writeObjectData

public void writeObjectData(ByteBuffer buffer,
                            Object object)

Specified by:
writeObjectData in class com.esotericsoftware.kryo.Serializer

registerSerializers

public static void registerSerializers(com.esotericsoftware.kryo.Kryo kryo)
Creates a new SynchronizedCollectionsSerializer and registers its serializer for the several synchronized Collections that can be created via Collections, including Maps.

Parameters:
kryo - the Kryo instance to set the serializer on.
See Also:
Collections.synchronizedCollection(Collection), Collections.synchronizedList(List), Collections.synchronizedSet(Set), Collections.synchronizedSortedSet(SortedSet), Collections.synchronizedMap(Map), Collections.synchronizedSortedMap(SortedMap)


Copyright © 2010-2011. All Rights Reserved.