# HG changeset patch # User Jan Vrany # Date 1328056679 0 # Node ID bd334e72464ff932976a98a271648afba347ad24 # Parent 2a7827f4dce2223ea4250573a572752981d26802 Fix in #read:into:at: diff -r 2a7827f4dce2 -r bd334e72464f terminals/Xtreams__PointerReadStream.st --- a/terminals/Xtreams__PointerReadStream.st Wed Feb 01 00:34:28 2012 +0000 +++ b/terminals/Xtreams__PointerReadStream.st Wed Feb 01 00:37:59 2012 +0000 @@ -43,16 +43,21 @@ ! read: anInteger into: aSequenceableCollection at: startIndex - - | count | - count := self available ifNil: [ anInteger ] ifNotNil: [ :available | available min: anInteger ]. - source type referentType = UnsignedChar - ifTrue: [ source copyAt: position to: aSequenceableCollection size: anInteger startingAt: startIndex. ] - ifFalse: [ startIndex to: startIndex + count - 1 do: [ :i | aSequenceableCollection at: i put: self get ] ]. - position := position + count. - ^count < anInteger - ifTrue: [ (Incomplete on: aSequenceableCollection count: count at: startIndex) raise ] - ifFalse: [ count ] + + | count available | + count := (available := self available) isNil ifTrue: [ anInteger ] ifFalse: [ available min: anInteger ]. + self breakPoint: #jv. + self breakPoint: #mk. + "There is no UnsignedChar here..." + source type referentType = UnsignedChar + ifTrue: [ source copyAt: position to: aSequenceableCollection size: anInteger startingAt: startIndex. ] + ifFalse: [ startIndex to: startIndex + count - 1 do: [ :i | aSequenceableCollection at: i put: self get ] ]. + position := position + count. + ^count < anInteger + ifTrue: [ (Incomplete on: aSequenceableCollection count: count at: startIndex) raise ] + ifFalse: [ count ] + + "Modified: / 01-02-2012 / 00:37:43 / Jan Vrany " ! ! !PointerReadStream methodsFor:'initialize-release'!