Package org.ehcache.impl.serialization
Class CompactJavaSerializer<T>
java.lang.Object
org.ehcache.impl.serialization.CompactJavaSerializer<T>
- All Implemented Interfaces:
org.ehcache.spi.serialization.Serializer<T>,org.ehcache.spi.serialization.StatefulSerializer<T>
public class CompactJavaSerializer<T>
extends Object
implements org.ehcache.spi.serialization.StatefulSerializer<T>
A trivially compressed Java serialization based serializer.
Class descriptors in the resultant bytes are encoded as integers. Mappings
between the integer representation and the ObjectStreamClass, and the
Class and the integer representation are stored in a single on-heap
map.
-
Constructor Summary
ConstructorsConstructorDescriptionCompactJavaSerializer(ClassLoader loader) Constructor to enable this serializer as a transient one. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Class<? extends org.ehcache.spi.serialization.Serializer<T>>booleanequals(T object, ByteBuffer binary) voidinit(org.ehcache.spi.persistence.StateRepository stateRepository) read(ByteBuffer binary)
-
Constructor Details
-
CompactJavaSerializer
Constructor to enable this serializer as a transient one.- Parameters:
loader- the classloader to use- See Also:
-
Serializer
-
-
Method Details
-
asTypedSerializer
-
init
public void init(org.ehcache.spi.persistence.StateRepository stateRepository) - Specified by:
initin interfaceorg.ehcache.spi.serialization.StatefulSerializer<T>
-
serialize
- Specified by:
serializein interfaceorg.ehcache.spi.serialization.Serializer<T>- Throws:
org.ehcache.spi.serialization.SerializerException
-
read
public T read(ByteBuffer binary) throws ClassNotFoundException, org.ehcache.spi.serialization.SerializerException - Specified by:
readin interfaceorg.ehcache.spi.serialization.Serializer<T>- Throws:
ClassNotFoundExceptionorg.ehcache.spi.serialization.SerializerException
-
equals
public boolean equals(T object, ByteBuffer binary) throws ClassNotFoundException, org.ehcache.spi.serialization.SerializerException - Specified by:
equalsin interfaceorg.ehcache.spi.serialization.Serializer<T>- Throws:
ClassNotFoundExceptionorg.ehcache.spi.serialization.SerializerException
-