Load from memory/stream


#1

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.


#2

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.


#3

That looks like exactly what I need. Thank you.