equal
deleted
inserted
replaced
580 "return the next count elements of the stream as a collection. |
580 "return the next count elements of the stream as a collection. |
581 Redefined to return a String or ByteArray and for optimization |
581 Redefined to return a String or ByteArray and for optimization |
582 " |
582 " |
583 |data count offset species| |
583 |data count offset species| |
584 |
584 |
585 mode == #readonly ifFalse:[ self errorReadOnly ]. |
|
586 |
|
587 species := self contentsSpecies. |
585 species := self contentsSpecies. |
588 |
586 |
589 self canReadWithoutBlocking ifFalse:[ |
587 self canReadWithoutBlocking ifFalse:[ |
590 ^ species new |
588 ^ species new |
591 ]. |
589 ]. |
604 "skip count objects, return the receiver |
602 "skip count objects, return the receiver |
605 redefined for optimization |
603 redefined for optimization |
606 " |
604 " |
607 |n avail| |
605 |n avail| |
608 |
606 |
609 mode == #readonly ifFalse:[ self errorReadOnly ]. |
|
610 n := count. |
607 n := count. |
|
608 |
|
609 n > 0 ifFalse:[ |
|
610 n ~~ 0 ifTrue:[ |
|
611 "dont know how to unread ..." |
|
612 PositionErrorSignal raiseRequest |
|
613 ]. |
|
614 ^ self |
|
615 ]. |
611 |
616 |
612 [ self canReadWithoutBlocking ] whileTrue:[ |
617 [ self canReadWithoutBlocking ] whileTrue:[ |
613 avail := readLimit - position. |
618 avail := readLimit - position. |
614 |
619 |
615 avail >= n ifTrue:[ |
620 avail >= n ifTrue:[ |