Class SerializationLibUtils
- java.lang.Object
-
- es.bsc.dataclay.serialization.lib.SerializationLibUtils
-
public final class SerializationLibUtils extends Object
This class contains utility functions for serialization.
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
DEBUG_ENABLED
Indicates if debug is enabled.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 objectstatic Object
deserializeBinary(byte[] data)
Reads a binary-serialized object from a byte arraystatic DataClayByteBuffer
newByteBuffer()
Creates a new byte bufferstatic DataClayByteBuffer
newByteBuffer(DataClayByteArray byteArray)
Creates a new byte buffer with bytes providedstatic byte[]
serializeBinary(Object o)
-
-
-
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 serializationhintForMissing
- Hint for associations without hint (for MakePersistent)numRefsPointingToObj
- Number of references pointing to object.thealias
- Alias of the object or null if noneorigObjectID
- Original object id in case of new versionrootLocation
- root location of the objecttheoriginLocation
- origin location of the object in case of replicathereplicaLocations
- IDs of locations this object was replicated totheisReadOnly
- indicates if object is read only- Returns:
- MetaData created.
-
serializeBinary
public static byte[] serializeBinary(Object o) throws IOException
- Throws:
IOException
-
-