Class 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.Object deserialize​(java.lang.Object data, boolean zipped)
      deserializes DBBinary/byte[] to object
      static byte[] serialize​(java.lang.Object o, boolean zip)
      serializes object to byte[]
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • serialize

        public static byte[] serialize​(java.lang.Object o,
                                       boolean zip)
                                throws java.io.IOException
        serializes object to byte[]
        Parameters:
        o - the object to serialize
        zip - 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.ClassNotFoundException
        deserializes DBBinary/byte[] to object
        Parameters:
        data - the data to read
        zipped - true if the data is compressed
        Returns:
        the deserialized object
        Throws:
        java.io.IOException - thrown when an error is encountered reading the data
        java.lang.ClassNotFoundException - thrown if the Class definition can not be found