SerializedType - The type of object that can be serialized.public class GZIPSerializationHandler<SerializedType> extends AbstractStreamSerializationHandler<SerializedType>
| Modifier and Type | Field and Description |
|---|---|
protected StreamSerializationHandler<SerializedType> |
baseHandler
The base handler that is being wrapped in a GZip.
|
| Constructor and Description |
|---|
GZIPSerializationHandler()
Creates a new
GZIPSerializationHandler that uses the default
JavaBinarySerializationHandler. |
GZIPSerializationHandler(StreamSerializationHandler<SerializedType> baseHandler)
Creates a new
GZIPSerializationHandler that will use the given
base handler. |
| Modifier and Type | Method and Description |
|---|---|
StreamSerializationHandler<SerializedType> |
getBaseHandler()
Gets the base handler whose output is serialized.
|
java.lang.Object |
readObject(java.io.InputStream stream)
Reads an object from the given stream.
|
void |
setBaseHandler(StreamSerializationHandler<SerializedType> baseHandler)
Sets the base handler whose output is serialized.
|
void |
writeObject(java.io.OutputStream stream,
SerializedType object)
Writes an object to a given output stream.
|
convertFromBytes, convertToBytes, readFromFile, writeToFilereadFromFile, writeToFilecloneequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadFromFile, writeToFileprotected StreamSerializationHandler<SerializedType> baseHandler
public GZIPSerializationHandler()
GZIPSerializationHandler that uses the default
JavaBinarySerializationHandler.public GZIPSerializationHandler(StreamSerializationHandler<SerializedType> baseHandler)
GZIPSerializationHandler that will use the given
base handler.baseHandler - The base handler to use with the gzip.public void writeObject(java.io.OutputStream stream,
SerializedType object)
throws java.io.IOException
StreamSerializationHandlerstream - The stream to write the object to.object - The object to write.java.io.IOException - If there is an i/o error.public java.lang.Object readObject(java.io.InputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
StreamSerializationHandlerstream - The stream to read an object from.java.io.IOException - If there is an i/o error.java.lang.ClassNotFoundException - If a class cannot be found.public StreamSerializationHandler<SerializedType> getBaseHandler()
public void setBaseHandler(StreamSerializationHandler<SerializedType> baseHandler)
baseHandler - The base handler.