de.javakaffee.kryoserializers
Class GregorianCalendarSerializer

java.lang.Object
  extended by com.esotericsoftware.kryo.Serializer
      extended by com.esotericsoftware.kryo.serialize.SimpleSerializer<GregorianCalendar>
          extended by de.javakaffee.kryoserializers.GregorianCalendarSerializer

public class GregorianCalendarSerializer
extends com.esotericsoftware.kryo.serialize.SimpleSerializer<GregorianCalendar>

A more efficient kryo Serializer for GregorianCalendar instances (which are created via Calendar.getInstance() if the locale is not thai or japanese, so JapaneseImperialCalendar and BuddhistCalendar are not supported by this serializer).

With the default reflection based serialization, a calendar instance (created via Calendar.getInstance(Locale.ENGLISH)) would take 1323 byte, this one only takes 24 byte.

Author:
Martin Grotzke

Constructor Summary
GregorianCalendarSerializer()
           
 
Method Summary
 GregorianCalendar read(ByteBuffer buffer)
          
 void write(ByteBuffer buffer, GregorianCalendar calendar)
          
 
Methods inherited from class com.esotericsoftware.kryo.serialize.SimpleSerializer
readObjectData, writeObjectData
 
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

GregorianCalendarSerializer

public GregorianCalendarSerializer()
Method Detail

read

public GregorianCalendar read(ByteBuffer buffer)

Specified by:
read in class com.esotericsoftware.kryo.serialize.SimpleSerializer<GregorianCalendar>

write

public void write(ByteBuffer buffer,
                  GregorianCalendar calendar)

Specified by:
write in class com.esotericsoftware.kryo.serialize.SimpleSerializer<GregorianCalendar>


Copyright © 2010-2011. All Rights Reserved.