Package util

Class Serializer


  • public class Serializer
    extends java.lang.Object
    Author:
    GBEMIRO JIBOYE
    • Constructor Summary

      Constructors 
      Constructor Description
      Serializer()  
    • Method Summary

      Modifier and Type Method Description
      static Savable deserialize​(java.lang.String encoded)  
      static byte[] getBytes​(java.lang.String ser)  
      static void main​(java.lang.String[] args)  
      static byte[] ser​(Savable yourObject)
      Prepare the byte array
      static java.lang.String serialize​(Savable yourObject)  
      • Methods inherited from class java.lang.Object

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

      • Serializer

        public Serializer()
    • Method Detail

      • serialize

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

        public static final Savable deserialize​(java.lang.String encoded)
      • getBytes

        public static final byte[] getBytes​(java.lang.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:
      • main

        public static void main​(java.lang.String[] args)