--- a/ReadWriteStream.st Tue Mar 04 13:36:39 2014 +0100
+++ b/ReadWriteStream.st Tue Mar 04 13:37:08 2014 +0100
@@ -79,6 +79,22 @@
"Modified: 5.2.1996 / 21:57:40 / stefan"
!
+next:count
+ "return the next count elements of the stream as aCollection,
+ which depends on the streams type - (see #contentsSpecies)."
+
+ |answer|
+
+ self contentsSpecies == collection class ifTrue:[
+ ((position + count) > readLimit) ifFalse:[
+ answer := collection copyFrom:position+1 to:position+count.
+ position := position+count.
+ ^ answer
+ ].
+ ].
+ ^ super next:count
+!
+
nextByte
"return the next element; advance read pointer.
return nil, if there is no next element"
@@ -164,10 +180,10 @@
!ReadWriteStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.32 2013-06-03 18:39:21 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.33 2014-03-04 12:37:08 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.32 2013-06-03 18:39:21 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.33 2014-03-04 12:37:08 stefan Exp $'
! !