MultiByteStream

stéphane ducasse ducasse at iam.unibe.ch
Thu Jun 16 14:17:14 UTC 2005


Hi

I did the following

|stream |
stream := (MultiByteFileStream fileNamed: 'BD4TabsDelimited.txt').
stream converter: MacRomanTextConverter new.self assert: (stream  
upTo: Character cr) =  '        Achille Talon    Greg        Pas de  
pitié pour Achille talon    13    1976    Dargaud    "sur la  
couverture ""une histoire du journal tintin"""            '

Now I'm trying to use MultiByteBinaryOrTextStream as follow

|stream |
     stream := MultiByteBinaryOrTextStream on: self  
completeWithTabbingLinesWithAccents encoding: 'mac-roman'.
     self assert: (stream upTo:  Character cr) = ' '

Does anybody know why I get ''  and not '        Achille Talon     
Greg        Pas de pitié pour Achille talon    13    1976     
Dargaud    "sur la couverture ""une histoire du journal  
tintin"""            '

It seems that the stream once instantiated is at the end.
(readLimit is 0 when the instance is created)

How can I say to the stream to be at the start. I tried reset,  
resetAtStart without success
when in an inspector I copy the writeLimit to the readLimit then  
upTo: works perfectly.

Is it a bug?

Stef






More information about the Squeak-dev mailing list