RWStream.st
changeset 1 a27a279701f8
child 3 24d81bf47225
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RWStream.st	Fri Jul 16 11:39:45 1993 +0200
@@ -0,0 +1,41 @@
+"
+ COPYRIGHT (c) 1989/90/91 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+WriteStream subclass:#ReadWriteStream
+       instanceVariableNames:''
+       classVariableNames:''
+       poolDictionaries:''
+       category:'Streams'
+!
+
+ReadWriteStream comment:'
+
+COPYRIGHT (c) 1989/90/91 by Claus Gittinger
+	      All Rights Reserved
+
+@(#)RWStream.st	2.3 92/06/06
+'!
+
+!ReadWriteStream methodsFor: 'access-reading'!
+
+peek
+    (position > readLimit) ifTrue: [ ^ nil ].
+    ^ collection at:position
+!
+
+next
+    |p|
+    (position > readLimit) ifTrue: [ ^ nil ].
+    p := position.
+    position := position + 1.
+    ^ collection at:p
+! !