Documentation of 'com.jstatcom.util.SerializationHelper' Java class
SerializationHelper
com.jstatcom.util

Class SerializationHelper



  • public final class SerializationHelper
    extends java.lang.Object
    Helper methods for (de)serialization and de/encoding to strings.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static <T> T decode(java.lang.String encodedString)
      Decode Base64 encoded string (with encode).
      static java.lang.String encode(java.lang.Object o)
      Base64 encoding of serializable objects.
      static byte[] getByteFromObject(java.lang.Object o)
      Serializes o to a byte array representation.
      static <T> T getObjectFromByteArray(byte[] byteArray)
      Deserializes an object from the byte array representation of the serialized version.
      • Methods inherited from class java.lang.Object

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

      • SerializationHelper

        public SerializationHelper()
    • Method Detail

      • getByteFromObject

        public static byte[] getByteFromObject(java.lang.Object o)
        Serializes o to a byte array representation.
        Parameters:
        o - object to serialize
        Returns:
        byte array with serialized o
        Throws:
        java.lang.IllegalArgumentException - if (!(o instanceof Serializable))
      • getObjectFromByteArray

        public static <T> T getObjectFromByteArray(byte[] byteArray)
        Deserializes an object from the byte array representation of the serialized version.
        Parameters:
        byteArray - byte array representation of serialized object
        Returns:
        deserialized object
      • encode

        public static java.lang.String encode(java.lang.Object o)
        Base64 encoding of serializable objects.
        Parameters:
        o - serializable object, may be null
        Returns:
        Base64 eoncoded string
        Throws:
        java.lang.IllegalArgumentException - if (o != null && !(o instanceof Serializable))
      • decode

        public static <T> T decode(java.lang.String encodedString)
        Decode Base64 encoded string (with encode).
        Parameters:
        encodedString - may be null
        Returns:
        instance of T or null if argument was null

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.