Class SerializationUtils


  • public abstract class SerializationUtils
    extends java.lang.Object

    This class is a clone of org.springframework.util.SerializationUtils.java

    Static utilities for serialization and deserialization.
    Author:
    Dave Syer
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object deserialize​(byte[] bytes)
      Deserialize the byte array into an object.
      static byte[] serialize​(java.lang.Object object)
      Serialize the given object to a byte array.
      • Methods inherited from class java.lang.Object

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

      • SerializationUtils

        public SerializationUtils()
    • Method Detail

      • serialize

        @Nullable
        public static byte[] serialize​(@Nullable
                                       java.lang.Object object)
        Serialize the given object to a byte array.
        Parameters:
        object - the object to serialize
        Returns:
        an array of bytes representing the object in a portable fashion
      • deserialize

        @Nullable
        public static java.lang.Object deserialize​(@Nullable
                                                   byte[] bytes)
        Deserialize the byte array into an object.
        Parameters:
        bytes - a serialized object
        Returns:
        the result of deserializing the bytes