Load from memory/stream


Is it possible to save to/load from memory?
I’m using an SQLite filesystem for my gameplay and engine data and I’d like to use the same filesystem for assets used by bsf.


Yes, but not directly though the Resources class (where you would normally load the resources from).

You need to use the BinarySerializer class directly to deserialize a resource. As input it accepts a DataStream which can be a file or a memory stream (or your own implementation). You can take a look at Resources::loadFromDiskAndDeserialize for an example how the resources system uses the serializer internally.


That looks like exactly what I need. Thank you.