java.lang.Object
org.apache.wicket.serialize.java.JavaSerializer
- All Implemented Interfaces:
ISerializer
- Direct Known Subclasses:
DeflatedJavaSerializer
An implementation of
ISerializer
based on Java Serialization (ObjectOutputStream,
ObjectInputStream)
Requires the application key to enable serialization and deserialisation outside thread in which
application thread local is set-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(byte[] data) Reconstructs the object from its serialized stateprotected ObjectInputStream
Gets a new instance of anObjectInputStream
with the providedInputStream
.protected ObjectOutputStream
Gets a new instance of anObjectOutputStream
with the providedOutputStream
.byte[]
Converts the object to byte array
-
Constructor Details
-
JavaSerializer
Construct.- Parameters:
applicationKey
- the name of the application
-
-
Method Details
-
serialize
Description copied from interface:ISerializer
Converts the object to byte array- Specified by:
serialize
in interfaceISerializer
- Parameters:
object
- the object to serialize- Returns:
- the serialized page as byte array
-
deserialize
Description copied from interface:ISerializer
Reconstructs the object from its serialized state- Specified by:
deserialize
in interfaceISerializer
- Parameters:
data
- the serialized state of the object- Returns:
- the object reconstructed from its serialized state
-
newObjectInputStream
Gets a new instance of anObjectInputStream
with the providedInputStream
.- 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
-
newObjectOutputStream
Gets a new instance of anObjectOutputStream
with the providedOutputStream
.- 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
-