Package dev.morphia.mapping
Class Serializer
- java.lang.Object
-
- dev.morphia.mapping.Serializer
-
public final class Serializer extends java.lang.Object- Author:
- Uwe Schaefer, (us@thomas-daily.de)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectdeserialize(java.lang.Object data, boolean zipped)deserializes DBBinary/byte[] to objectstatic byte[]serialize(java.lang.Object o, boolean zip)serializes object to byte[]
-
-
-
Method Detail
-
serialize
public static byte[] serialize(java.lang.Object o, boolean zip) throws java.io.IOExceptionserializes object to byte[]- Parameters:
o- the object to serializezip- true if the data should be compressed- Returns:
- the serialized bytes
- Throws:
java.io.IOException- thrown when an error is encountered writing the data
-
deserialize
public static java.lang.Object deserialize(java.lang.Object data, boolean zipped) throws java.io.IOException, java.lang.ClassNotFoundExceptiondeserializes DBBinary/byte[] to object- Parameters:
data- the data to readzipped- true if the data is compressed- Returns:
- the deserialized object
- Throws:
java.io.IOException- thrown when an error is encountered reading the datajava.lang.ClassNotFoundException- thrown if the Class definition can not be found
-
-