SmartRefStream broken?
Andreas Raab
andreas.raab at gmx.de
Tue Nov 14 22:02:00 UTC 2006
Benjamin Pollack wrote:
> Is there a reason why SmartRefStream has such a radically different
> interface than ReferenceStream, even though it's a direct subclass?
Yes. The reason is that you shouldn't use SmartRefStream the way you're
using it. The "correct" way is using #fileOutClass:andObject: like here:
Writing:
file := FileStream newFileNamed: 'data.obj'.
file fileOutClass: nil "no class" andObject: data.
Reading:
file := FileStream readOnlyFileNamed: 'data.obj'.
data := file fileInObjectAndCode.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|