Class Serializer

java.lang.Object
util.Serializer

public class Serializer extends Object
  • Constructor Details

    • Serializer

      public Serializer()
  • Method Details

    • serialize

      public static final String serialize(Savable yourObject)
      Parameters:
      yourObject - Serializes the object to a byte array and returns it as a string printed as: [num1, num2, num3, num4, .....]
      Returns:
      a string representation for the byte array representation of the object.
    • deserialize

      public static final Savable deserialize(String encoded)
    • getBytes

      public static final byte[] getBytes(String ser)
      Parameters:
      ser - The serialized format for the byte array of the object
      Returns:
      the byte array from the serialized format of the object
    • ser

      public static final byte[] ser(Savable yourObject)
      Prepare the byte array
      Parameters:
      yourObject -
      Returns:
    • deSer

      private static final Object deSer(byte[] yourBytes)
      Create an object from a byte array:
      Parameters:
      yourBytes -
      Returns:
    • stringifyBytes

      private static String stringifyBytes(byte[] data)
    • main

      public static void main(String[] args)