[squeak-dev] #saveOnFile won't do
Aidan Gauland
wgsilkie at ihug.co.nz
Sun Dec 14 03:42:51 UTC 2008
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
More information about the Squeak-dev
mailing list
|