[squeak-dev] #saveOnFile won't do
Rob Rothwell
r.j.rothwell at gmail.com
Sun Dec 14 03:56:17 UTC 2008
You could also try SandstoneDb if you are creating instances of your objects
and just want to save those instances to disk and have them automatically
loaded when the image starts up...
Take care,
Rob
On Sat, Dec 13, 2008 at 10:42 PM, Aidan Gauland <wgsilkie at ihug.co.nz> wrote:
> Matthew Fulmer wrote:
>
>> If you look at the implementation of saveOnFile:, most of the
>> work is done by ReadWriteStream >> fileOutClass:andObject:
>>
>> so, you can use that method to write your object out to a
>> memory-backed ReadWriteStream rather than a disk-backed
>> FileStream. This will give you a ByteArray of the object, which
>> you can store as a class variable of your game or something.
>>
>> If you go a little deeper, you will discover SmartRefStream,
>> which is the serializer responsible for this feature.
>>
>
> Ah ha! SmartRefStream is what I want. I saw that when I was poking
> around, but I couldn't tell if that would just give me trouble if I tried to
> use it for this.
>
> Thanks,
> Aidan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081213/90665ab0/attachment.htm
More information about the Squeak-dev
mailing list
|