[squeak-dev] surprising behavior from MultiByteBinaryOrTextStream>>#contents

Chris Muller asqueaker at gmail.com
Tue Sep 3 19:51:57 UTC 2013


When I

     (WriteStream on: String new) nextPutAll: 'hello'; contents

I get the expected result, 'hello'.  However, when I use a
MultiByteBinaryOrTextStream:

     (MultiByteBinaryOrTextStream on: String new) nextPutAll: 'hello'; contents

Empty string.

It seems the latter only provides contents upToEnd from its current
position, so I have to:

     (MultiByteBinaryOrTextStream on: String new) nextPutAll: 'hello';
position: 0; contents

to get what I expect.

#contents should always provide the full contents of the stream, shouldn't it?


More information about the Squeak-dev mailing list