org.mapdb
Class Serializer.CompressionWrapper<E>

java.lang.Object
  extended by org.mapdb.Serializer.CompressionWrapper<E>
All Implemented Interfaces:
Serializable, Serializer<E>
Enclosing interface:
Serializer<A>

public static final class Serializer.CompressionWrapper<E>
extends Object
implements Serializer<E>, Serializable

wraps another serializer and (de)compresses its output/input

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mapdb.Serializer
Serializer.CompressionWrapper<E>
 
Field Summary
protected  ThreadLocal<CompressLZF> LZF
           
protected  Serializer<E> serializer
           
 
Fields inherited from interface org.mapdb.Serializer
BASIC, BOOLEAN, BYTE_ARRAY, BYTE_ARRAY_NOSIZE, CHAR_ARRAY, DOUBLE_ARRAY, ILLEGAL_ACCESS, INT_ARRAY, INTEGER, JAVA, LONG, LONG_ARRAY, STRING, STRING_ASCII, STRING_INTERN, STRING_NOSIZE, UUID
 
Constructor Summary
  Serializer.CompressionWrapper(Serializer<E> serializer)
           
protected Serializer.CompressionWrapper(SerializerBase serializerBase, DataInput is, SerializerBase.FastArrayList<Object> objectStack)
          used for deserialization
 
Method Summary
 E deserialize(DataInput in, int available)
          Deserialize the content of an object from a DataInput.
 boolean equals(Object o)
           
 int fixedSize()
          Data could be serialized into record with variable size or fixed size.
 int hashCode()
           
 void serialize(DataOutput out, E value)
          Serialize the content of an object into a ObjectOutput
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serializer

protected final Serializer<E> serializer

LZF

protected final ThreadLocal<CompressLZF> LZF
Constructor Detail

Serializer.CompressionWrapper

public Serializer.CompressionWrapper(Serializer<E> serializer)

Serializer.CompressionWrapper

protected Serializer.CompressionWrapper(SerializerBase serializerBase,
                                        DataInput is,
                                        SerializerBase.FastArrayList<Object> objectStack)
                                 throws IOException
used for deserialization

Throws:
IOException
Method Detail

serialize

public void serialize(DataOutput out,
                      E value)
               throws IOException
Description copied from interface: Serializer
Serialize the content of an object into a ObjectOutput

Specified by:
serialize in interface Serializer<E>
Parameters:
out - ObjectOutput to save object into
value - Object to serialize
Throws:
IOException

deserialize

public E deserialize(DataInput in,
                     int available)
              throws IOException
Description copied from interface: Serializer
Deserialize the content of an object from a DataInput.

Specified by:
deserialize in interface Serializer<E>
Parameters:
in - to read serialized data from
available - how many bytes are available in DataInput for reading, may be -1 (in streams) or 0 (null).
Returns:
deserialized object
Throws:
IOException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

fixedSize

public int fixedSize()
Description copied from interface: Serializer
Data could be serialized into record with variable size or fixed size. Some optimizations can be applied to serializers with fixed size

Specified by:
fixedSize in interface Serializer<E>
Returns:
fixed size or -1 for variable size


Copyright © 2014. All Rights Reserved.