Stream Question

Bijan Parsia bparsia at email.unc.edu
Wed Sep 19 15:38:20 UTC 2001


On Wed, 19 Sep 2001, Ken G. Brown wrote:

> Ok, I see that I have to keep track of positions which I had at first 
> assumed was being handled by the stream itself.

It was. You wrote to the stream and changed the position. You read from
that position. What did you want to have happen?

> How does one normally handle the case when writing to a stream 
> approaches the end of allotted space, for example writing to a 
> Transcript?

"Allotted space"? Do you mean the size of the Collection initially fed to
the stream? The stream will expand it as necessary (usually by doubling).

Otherwise, I'm not sure what you mean.

Note that you can have muliple streams on the same collection.

> I suppose if near the end you could reset but that may 
> not have the desirable results.

Try:

	(((WriteStream on: '') nextPutAll: 'willExpand') 
			       nextPutAll: ' a
lot') contents

> Is there some sort of first in first 
> out stream available somewhere?

You need to explain your needs a bit better for me. I don't understand
what you're trying to do.

Cheers,
Bijan Parsia.





More information about the Squeak-dev mailing list