|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.impl.serialization.CompactJavaSerializer<T>
public class CompactJavaSerializer<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.
| Nested Class Summary | |
|---|---|
protected static class |
CompactJavaSerializer.SerializableDataKey
|
| Constructor Summary | |
|---|---|
|
CompactJavaSerializer(java.lang.ClassLoader loader)
|
protected |
CompactJavaSerializer(java.lang.ClassLoader loader,
java.util.Map<java.lang.Integer,java.io.ObjectStreamClass> mappings)
|
| Method Summary | |
|---|---|
void |
close()
|
protected static java.io.ObjectStreamClass |
disconnect(java.io.ObjectStreamClass desc)
|
boolean |
equals(T object,
java.nio.ByteBuffer binary)
Checks if the given instance and serial form are representations of the same instance. |
java.io.ObjectInputStream |
getObjectInputStream(java.io.InputStream input)
|
java.io.ObjectOutputStream |
getObjectOutputStream(java.io.OutputStream out)
|
protected int |
getOrAddMapping(java.io.ObjectStreamClass desc)
|
protected java.util.Map<java.lang.Integer,java.io.ObjectStreamClass> |
getSerializationMappings()
|
T |
read(java.nio.ByteBuffer binary)
Reconstructs an instance from the given serial form. |
java.nio.ByteBuffer |
serialize(T object)
Transforms the given instance into its serial form. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompactJavaSerializer(java.lang.ClassLoader loader)
protected CompactJavaSerializer(java.lang.ClassLoader loader,
java.util.Map<java.lang.Integer,java.io.ObjectStreamClass> mappings)
| Method Detail |
|---|
protected java.util.Map<java.lang.Integer,java.io.ObjectStreamClass> getSerializationMappings()
public java.nio.ByteBuffer serialize(T object)
throws SerializerException
Serializer
serialize in interface Serializer<T>object - the instance to serialize
SerializerException - if serialization fails
public T read(java.nio.ByteBuffer binary)
throws java.lang.ClassNotFoundException,
SerializerException
Serializer
read in interface Serializer<T>binary - the binary representation of the serial form
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found
SerializerException - if reading the byte buffer fails
public java.io.ObjectOutputStream getObjectOutputStream(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public java.io.ObjectInputStream getObjectInputStream(java.io.InputStream input)
throws java.io.IOException
java.io.IOException
public boolean equals(T object,
java.nio.ByteBuffer binary)
throws java.lang.ClassNotFoundException,
SerializerException
Serializer
equals in interface Serializer<T>object - the instance to checkbinary - the serial form to check
true if both parameters represent the same instance, false otherwise
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found
SerializerException - if reading the byte buffer fails
protected int getOrAddMapping(java.io.ObjectStreamClass desc)
throws java.io.IOException
java.io.IOExceptionpublic void close()
close in interface java.io.Closeableprotected static java.io.ObjectStreamClass disconnect(java.io.ObjectStreamClass desc)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||