[Help] How can I fileout to an internal stream?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Help] How can I fileout to an internal stream?

Jerome Peace
How can I fileout to an internal stream?


Ok. I’ve run into a problem in 3dot10.
When writing out text in a Sans Vera font it reads
back in Accuny. That is, save the text morph and read
it back.

Now I’d like to write a test for this w/o actually
having to write a file to disk.

All I need is to put an object into a stream encoded
as if for saving and then read it back decoded from
the same stream.

What’s the best way to do that? I’ve chased methods
till my eyes hurt and would like help, hopefully from
someone who already knows the answer.

Yours in curiosity and service, --Jerome Peace


       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

Reply | Threaded
Open this post in threaded view
|

Re: [Help] How can I fileout to an internal stream?

Edgar J. De Cleene



El 9/6/07 8:53 PM, "Jerome Peace" <[hidden email]> escribió:

> How can I fileout to an internal stream?
>
>
> Ok. I¹ve run into a problem in 3dot10.
> When writing out text in a Sans Vera font it reads
> back in Accuny. That is, save the text morph and read
> it back.
>
> Now I¹d like to write a test for this w/o actually
> having to write a file to disk.
>
> All I need is to put an object into a stream encoded
> as if for saving and then read it back decoded from
> the same stream.
>
> What¹s the best way to do that? I¹ve chased methods
> till my eyes hurt and would like help, hopefully from
> someone who already knows the answer.
>
> Yours in curiosity and service, --Jerome Peace

On the inspector.
| rw |
rw := RWBinaryOrTextStream with: ''.
rw fileOutClass: nil andObject: self .
rw inspect

On this new inspector

| morphOrList |
self reset .

morphOrList _ self fileInObjectAndCode.
    (morphOrList isKindOf: SqueakPage) ifTrue: [morphOrList _ morphOrList
contentsMorph].
    Smalltalk isMorphic
        ifTrue: [ActiveWorld addMorphsAndModel: morphOrList]
        ifFalse:
            [morphOrList isMorph ifFalse: [self inform: 'Can only load a
single morph
into an mvc project via this mechanism.'].
            morphOrList openInWorld]

Now you could see how and optimize.

By the way, is very odd see selected Text is changing fonts.

Saludos amigo !

Edgar