Class CompressingSerializer
java.lang.Object
org.apache.commons.jcs3.utils.serialization.StandardSerializer
org.apache.commons.jcs3.utils.serialization.CompressingSerializer
- All Implemented Interfaces:
- IElementSerializer
Performs default serialization and de-serialization. It gzips the value.
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructorCompressingSerializer(IElementSerializer serializer) Wrapper constructor
- 
Method SummaryModifier and TypeMethodDescription<T> TdeSerialize(byte[] data, ClassLoader loader) Uses default de-serialization to turn a byte array into an object.<T> byte[]serialize(T obj) Serializes an object using default serialization.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.jcs3.engine.behavior.IElementSerializerdeSerializeFrom, deSerializeFrom, deSerializeFrom, serializeTo, serializeTo, serializeTo
- 
Constructor Details- 
CompressingSerializerpublic CompressingSerializer()Default constructor
- 
CompressingSerializerWrapper constructor- Parameters:
- serializer- the wrapped serializer
- Since:
- 3.1
 
 
- 
- 
Method Details- 
serializeSerializes an object using default serialization. Compresses the byte array.- Specified by:
- serializein interface- IElementSerializer
- Overrides:
- serializein class- StandardSerializer
- Type Parameters:
- T- the type of the object
- Parameters:
- obj- object
- Returns:
- byte[]
- Throws:
- IOException- on i/o problem
 
- 
deSerializepublic <T> T deSerialize(byte[] data, ClassLoader loader) throws IOException, ClassNotFoundException Uses default de-serialization to turn a byte array into an object. Decompresses the value first. All exceptions are converted into IOExceptions.- Specified by:
- deSerializein interface- IElementSerializer
- Overrides:
- deSerializein class- StandardSerializer
- Parameters:
- data- data bytes
- loader- class loader to use
- Returns:
- Object
- Throws:
- IOException- on i/o problem
- ClassNotFoundException- if class is not found during deserialization
 
 
-