Please note that the "location" is not related in any way to a folder or a file, it can be but this is dependent on the StorageSystem implementation you are using (the storage system "FileStorageSystem" that we took as an example above WILL use/create a folder with the exact same name as the location, but this will not always be the case for all)
You can then write/read anything from it as long as you know the key
1
byte[] data;
2
...
3
storageLocation.set("test", data);
4
data = storageLocation.get("test");
Copied!
WARNING: You shouldn't open a data location using a different StorageSystem than the one it has been created with
Integration with SerializableData
Most of the data that you will store will be in the form of SerializableData. (see data)
There are two kinds of SerializableData that you would want to store:
1.
Data which should not change but be unique and applied to multiple objects
2.
Data linked to an element (or shared to multiple) and which should be synchronized
For the first type you would need:
1
// The data is gonna be retrieved, cloned and applied to the DataContainer specified