Class Serializer

java.lang.Object
com.github.gbenroscience.util.Serializer

public class Serializer extends Object
1. Interface must extend Serializable for ObjectOutputStream to work.
  • Constructor Details

    • Serializer

      public Serializer()
  • Method Details

    • serialize

      public static final String serialize(Savable yourObject)
      Converts an object to a Base64 encoded string.
    • deserialize

      public static final Savable deserialize(String encoded)
      Reconstructs an object from a Base64 encoded string.
    • ser

      public static final byte[] ser(Serializable yourObject)
      Internal: Object to Byte Array
    • deepClone

      public static <T extends Serializable> T deepClone(T object)
      Performs a 100% deep clone of any Serializable object (including 2D arrays).
      Type Parameters:
      T - The type of the object
      Parameters:
      object - The object to clone
      Returns:
      A completely independent copy of the object
    • main

      public static void main(String[] args)