NonPositionableExternalStream.st
branchjv
changeset 18117 eb433f2c42b2
parent 18107 d46c13a0795b
parent 15924 73f0da45e706
child 18120 e3a375d5f6a8
equal deleted inserted replaced
18116:bf7f37b63ea2 18117:eb433f2c42b2
   204     ^ PositionError raiseRequestWith:self
   204     ^ PositionError raiseRequestWith:self
   205 
   205 
   206     "
   206     "
   207      Stderr positionError
   207      Stderr positionError
   208     "
   208     "
       
   209 ! !
       
   210 
       
   211 !NonPositionableExternalStream methodsFor:'initialization'!
       
   212 
       
   213 initialize
       
   214     "non-positionalble streams do now work well when buffered"
       
   215 
       
   216     super initialize.
       
   217     buffered := false.
   209 ! !
   218 ! !
   210 
   219 
   211 !NonPositionableExternalStream methodsFor:'non homogenous reading'!
   220 !NonPositionableExternalStream methodsFor:'non homogenous reading'!
   212 
   221 
   213 nextBytes:count into:anObject startingAt:start
   222 nextBytes:count into:anObject startingAt:start
   559     offset := initialOffset.
   568     offset := initialOffset.
   560     remaining := initialWriteCount.
   569     remaining := initialWriteCount.
   561 
   570 
   562     wasBlocking := self blocking:false.
   571     wasBlocking := self blocking:false.
   563     [remaining ~~ 0] whileTrue:[
   572     [remaining ~~ 0] whileTrue:[
   564 	count := super nextPutBytes:remaining from:buffer startingAt:offset.
   573         count := super nextPutBytes:remaining from:buffer startingAt:offset.
   565 	count ~~ remaining ifTrue:[ self writeWait. ].
   574         count ~~ remaining ifTrue:[ "Transcript showCR:'writeWait'. "self writeWait. ].
   566 
   575 
   567 	remaining := remaining - count.
   576         remaining := remaining - count.
   568 	offset := offset + count.
   577         offset := offset + count.
   569     ].
   578     ].
   570     wasBlocking ifTrue:[self blocking:true].
   579     wasBlocking ifTrue:[self blocking:true].
   571 
   580 
   572     ^ offset - initialOffset.
   581     ^ offset - initialOffset.
   573 ! !
   582 ! !
   574 
   583 
   575 !NonPositionableExternalStream class methodsFor:'documentation'!
   584 !NonPositionableExternalStream class methodsFor:'documentation'!
   576 
   585 
   577 version
   586 version
   578     ^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.64 2013-10-28 17:28:00 stefan Exp $'
   587     ^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.67 2014-01-30 16:41:04 stefan Exp $'
   579 !
   588 !
   580 
   589 
   581 version_CVS
   590 version_CVS
   582     ^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.64 2013-10-28 17:28:00 stefan Exp $'
   591     ^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.67 2014-01-30 16:41:04 stefan Exp $'
   583 ! !
   592 ! !
   584 
   593