public class CompactJavaSerializer<T>
extends java.lang.Object
implements org.ehcache.spi.serialization.StatefulSerializer<T>
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 and Description |
|---|
CompactJavaSerializer(java.lang.ClassLoader loader)
Constructor to enable this serializer as a transient one.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> java.lang.Class<? extends org.ehcache.spi.serialization.Serializer<T>> |
asTypedSerializer() |
boolean |
equals(T object,
java.nio.ByteBuffer binary) |
void |
init(org.ehcache.spi.persistence.StateRepository stateRepository) |
T |
read(java.nio.ByteBuffer binary) |
java.nio.ByteBuffer |
serialize(T object) |
public CompactJavaSerializer(java.lang.ClassLoader loader)
loader - the classloader to useSerializerpublic static <T> java.lang.Class<? extends org.ehcache.spi.serialization.Serializer<T>> asTypedSerializer()
public void init(org.ehcache.spi.persistence.StateRepository stateRepository)
init in interface org.ehcache.spi.serialization.StatefulSerializer<T>public java.nio.ByteBuffer serialize(T object) throws org.ehcache.spi.serialization.SerializerException
serialize in interface org.ehcache.spi.serialization.Serializer<T>org.ehcache.spi.serialization.SerializerExceptionpublic T read(java.nio.ByteBuffer binary) throws java.lang.ClassNotFoundException, org.ehcache.spi.serialization.SerializerException
read in interface org.ehcache.spi.serialization.Serializer<T>java.lang.ClassNotFoundExceptionorg.ehcache.spi.serialization.SerializerExceptionpublic boolean equals(T object, java.nio.ByteBuffer binary) throws java.lang.ClassNotFoundException, org.ehcache.spi.serialization.SerializerException
equals in interface org.ehcache.spi.serialization.Serializer<T>java.lang.ClassNotFoundExceptionorg.ehcache.spi.serialization.SerializerException