ReadWriteStream.st
changeset 19883 9d05c218e05c
parent 17613 e3524b50162f
child 19892 d1aecb538df5
child 20098 2b116aca09dc
--- a/ReadWriteStream.st	Wed May 18 20:35:53 2016 +0200
+++ b/ReadWriteStream.st	Thu May 19 10:34:56 2016 +0200
@@ -121,6 +121,13 @@
 
 !ReadWriteStream methodsFor:'accessing'!
 
+clear
+    "re-initialize the stream to write to the beginning and
+     to not read any data."
+
+    position := readLimit := 0.
+!
+
 contents
     "return the contents as written so far;
      redefined to prevent confusion resulting due to 
@@ -136,19 +143,22 @@
 !
 
 reset
-    "set the read position to the beginning of the collection"
-
-    self resetPosition
-
-!
-
-resetPosition
     "set the read position to the beginning of the collection.
      Because I am a read/write stream, the readLimit is set to the current write position.
      Thus, the just written data can be read back."
 
     readLimit := position max:readLimit.
-    super resetPosition
+    position := 0.
+!
+
+resetPosition
+    <resource: #obsolete>
+    "set the read position to the beginning of the collection.
+     Because I am a read/write stream, the readLimit is set to the current write position.
+     Thus, the just written data can be read back."
+
+    readLimit := position max:readLimit.
+    position := 0.
 ! !
 
 !ReadWriteStream methodsFor:'converting'!
@@ -196,10 +206,10 @@
 !ReadWriteStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.39 2015-03-12 19:27:01 stefan Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ReadWriteStream.st,v 1.39 2015-03-12 19:27:01 stefan Exp $'
+    ^ '$Header$'
 ! !