Package jhd.Serialize
Class Serializer
java.lang.Object
jhd.Serialize.Serializer
public class Serializer
extends java.lang.Object
A Wrapper class for object serialization
-
Constructor Summary
Constructors Constructor Description Serializer()
-
Method Summary
Modifier and Type Method Description java.lang.Object
ReadSerializedObject(java.lang.String path)
Restores an object from serialized (binary) formatboolean
SaveObjectAsSerialized(java.lang.Object theObject, java.lang.String path)
Saves an object in serialized (binary) formatMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
SaveObjectAsSerialized
public boolean SaveObjectAsSerialized(java.lang.Object theObject, java.lang.String path)Saves an object in serialized (binary) format- Parameters:
theObject
- Reference to a serializable objectpath
- An absolute file save path. File name should end in .ser- Returns:
- True if successful
-
ReadSerializedObject
public java.lang.Object ReadSerializedObject(java.lang.String path)Restores an object from serialized (binary) format- Parameters:
path
- An absolute file save path. File name should end in .ser- Returns:
- The object or null if failed to read.
-