|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteneter.messaging.dataprocessing.serializing.GZipSerializer
public class GZipSerializer
Serializer compressing and decompressing data. The serializer internally uses GZipStream to compress and decompress data.
Example shows how to serialize data.
// Creat the serializer. GZipSerializer aSerializer = new GZipSerializer(); // Create some data to be serialized. MyData aData = new MyData(); ... // Serialize data. Serialized data will be compressed. object aSerializedData = aSerializer.serialize(aData, MyData.class); ... // Deserialize data MyData aDeserialized = aSerializer.deserialize(aSerializedData, MyData.class);
Constructor Summary | |
---|---|
GZipSerializer()
Constructs the serializer with XmlStringSerializer as the underlying serializer. |
|
GZipSerializer(ISerializer underlyingSerializer)
Constructs the serializer with the given underlying serializer. |
Method Summary | ||
---|---|---|
|
deserialize(java.lang.Object serializedData,
java.lang.Class<T> clazz)
Deserializes compressed data into the specified type. |
|
|
serialize(T dataToSerialize,
java.lang.Class<T> clazz)
Serializes the given data with using the compression. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GZipSerializer()
public GZipSerializer(ISerializer underlyingSerializer)
underlyingSerializer
- Method Detail |
---|
public <T> java.lang.Object serialize(T dataToSerialize, java.lang.Class<T> clazz) throws java.lang.Exception
serialize
in interface ISerializer
dataToSerialize
- Data to be serialized.clazz
- represents the serialized type.
java.lang.Exception
- If the serialization fails.public <T> T deserialize(java.lang.Object serializedData, java.lang.Class<T> clazz) throws java.lang.Exception
deserialize
in interface ISerializer
serializedData
- Data to be deserialized.
java.lang.Exception
- If the deserialization fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |