Class SerializationLibUtils


  • public final class SerializationLibUtils
    extends Object
    This class contains utility functions for serialization.
    • Field Detail

      • DEBUG_ENABLED

        protected static final boolean DEBUG_ENABLED
        Indicates if debug is enabled.
    • Method Detail

      • newByteBuffer

        public static DataClayByteBuffer newByteBuffer()
        Creates a new byte buffer
        Returns:
        New byte buffer
      • newByteBuffer

        public static DataClayByteBuffer newByteBuffer​(DataClayByteArray byteArray)
        Creates a new byte buffer with bytes provided
        Parameters:
        byteArray - Byte array containing bytes
        Returns:
        Byte buffer to read bytes.
      • createMetaData

        public static DataClayObjectMetaData createMetaData​(IdentityHashMap<Object,​Integer> curSerObjs,
                                                            ExecutionEnvironmentID hintForMissing,
                                                            int numRefsPointingToObj,
                                                            ObjectID origObjectID,
                                                            ExecutionEnvironmentID rootLocation,
                                                            ExecutionEnvironmentID theoriginLocation,
                                                            Set<ExecutionEnvironmentID> thereplicaLocations,
                                                            String thealias,
                                                            boolean theisReadOnly)
        This function creates a metadata of an object
        Parameters:
        curSerObjs - Currently found objects during serialization
        hintForMissing - Hint for associations without hint (for MakePersistent)
        numRefsPointingToObj - Number of references pointing to object.
        thealias - Alias of the object or null if none
        origObjectID - Original object id in case of new version
        rootLocation - root location of the object
        theoriginLocation - origin location of the object in case of replica
        thereplicaLocations - IDs of locations this object was replicated to
        theisReadOnly - indicates if object is read only
        Returns:
        MetaData created.
      • deserializeBinary

        public static Object deserializeBinary​(byte[] data)
                                        throws Exception
        Reads a binary-serialized object from a byte array
        Parameters:
        data - containing the serialized object
        Returns:
        the object read from the data
        Throws:
        Exception