java.lang.Object
org.apache.wicket.serialize.java.JavaSerializer
org.apache.wicket.serialize.java.DeflatedJavaSerializer
- All Implemented Interfaces:
ISerializer
A
JavaSerializer
that deflates the outputstream on the fly, reducing page store size by
up to a factor 8. Be advised that deflating serialized objects comes at a price of about 2-20ms
per page request, depending on the size of the page and the cpu power of the machine.
To use this serializer, put the following code in your application's init:
getFrameworkSettings().setSerializer(new DeflatedJavaSerializer(getApplicationKey()));
- Author:
- papegaaij
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Deflater
Creates theDeflater
.protected ObjectInputStream
Gets a new instance of anObjectInputStream
with the providedInputStream
.protected ObjectOutputStream
Gets a new instance of anObjectOutputStream
with the providedOutputStream
.Methods inherited from class org.apache.wicket.serialize.java.JavaSerializer
deserialize, serialize
-
Constructor Details
-
DeflatedJavaSerializer
Construct.- Parameters:
applicationKey
-
-
-
Method Details
-
newObjectOutputStream
Description copied from class:JavaSerializer
Gets a new instance of anObjectOutputStream
with the providedOutputStream
.- Overrides:
newObjectOutputStream
in classJavaSerializer
- Parameters:
out
- The output stream that should be used for the writing- Returns:
- a new object output stream instance
- Throws:
IOException
- if an I/O error occurs while writing stream header
-
createDeflater
Creates theDeflater
. Override this method to customize the deflater, for example to change the compression level and/or strategy.- Returns:
- the
Deflater
-
newObjectInputStream
Description copied from class:JavaSerializer
Gets a new instance of anObjectInputStream
with the providedInputStream
.- Overrides:
newObjectInputStream
in classJavaSerializer
- Parameters:
in
- The input stream that should be used for the reading- Returns:
- a new object input stream instance
- Throws:
IOException
- if an I/O error occurs while reading stream header
-