Package io.bdeploy.bhive.util
Class StorageHelper
java.lang.Object
io.bdeploy.bhive.util.StorageHelper
Provides functionality to persist and load model objects from persistent
storage.
Methods are required to produce reproducible results per object.
ATTENTION: The underlying implementation may NOT be changed without exact knowledge of the impact. The objects may be hashed and stored in an object database, which means that changing the algorithm will basically break any hive which used the existing algorithm.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TDe-serializes an Object of given type from a given filestatic <T> TfromRawBytes(byte[] bytes, Class<T> clazz) De-serializes an Object of given type from a byte[].static <T> TfromStream(InputStream is, Class<T> clazz) De-serializes an Object of given type from a stream into memory.static <T> TfromYamlStream(InputStream is, Class<T> clazz) De-serializes an Object of given type from a YAML content stream into memory.static byte[]toRawBytes(Object o) Serializes any in-memory Object to a stable storage-friendly byte[].static byte[]Serializes any in-memory Object to a stable storage-friendly YAML style byte[].
-
Constructor Details
-
StorageHelper
public StorageHelper()
-
-
Method Details
-
toRawBytes
Serializes any in-memory Object to a stable storage-friendly byte[]. -
toRawYamlBytes
Serializes any in-memory Object to a stable storage-friendly YAML style byte[]. -
fromRawBytes
De-serializes an Object of given type from a byte[]. -
fromPath
De-serializes an Object of given type from a given file -
fromStream
De-serializes an Object of given type from a stream into memory. -
fromYamlStream
De-serializes an Object of given type from a YAML content stream into memory.
-