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 booleanDEBUG_ENABLEDIndicates if debug is enabled.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataClayObjectMetaDatacreateMetaData(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 ObjectdeserializeBinary(byte[] data)Reads a binary-serialized object from a byte arraystatic DataClayByteBuffernewByteBuffer()Creates a new byte bufferstatic DataClayByteBuffernewByteBuffer(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
-
-