#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Thu, 19 May 2016 10:34:56 +0200
changeset 19883 9d05c218e05c
parent 19881 8ba1bb8e7506
child 19884 e2af0c5af2b4
#FEATURE by stefan class: ReadWriteStream added: #clear -- needed for new bridge changed: #reset #resetPosition
ReadWriteStream.st
--- 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$'
 ! !