Package one.nio.serial
Class SerializedWrapper<T>
- java.lang.Object
-
- one.nio.serial.SerializedWrapper<T>
-
- All Implemented Interfaces:
Serializable
public class SerializedWrapper<T> extends Object implements Serializable
A wrapper for a preserialized object. Helps to avoid double serialization. The wrapper automatically unpacks the original object during deserialization.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SerializedWrapper(byte[] serialized)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)byte[]getSerialized()inthashCode()Tunwrap()static <T> SerializedWrapper<T>wrap(T object)
-
-
-
Method Detail
-
getSerialized
public byte[] getSerialized()
-
wrap
public static <T> SerializedWrapper<T> wrap(T object) throws IOException
- Throws:
IOException
-
unwrap
public T unwrap() throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
-