#on: - set readLimit to 0, so that setToEnd positions to end of written
authorStefan Vogel <sv@exept.de>
Wed, 08 Jul 2009 20:01:03 +0200
changeset 11794 ad5fcc151a09
parent 11793 87abb9669c47
child 11795 1959524b4c2f
#on: - set readLimit to 0, so that setToEnd positions to end of written contents instead of to the end of the (empty) collection.
WriteStream.st
--- a/WriteStream.st	Tue Jul 07 19:21:10 2009 +0200
+++ b/WriteStream.st	Wed Jul 08 20:01:03 2009 +0200
@@ -236,6 +236,11 @@
 
 !WriteStream methodsFor:'private-accessing'!
 
+on:aCollection
+    super on:aCollection.
+    readLimit := 0.
+!
+
 on:aCollection from:start to:last
     "create and return a new stream for writing onto aCollection, where
      writing is limited to the elements in the range start to last."
@@ -595,7 +600,7 @@
      This is provided for compatibility with externalStream;
      to support binary storage"
 
-    anObject class isBytes ifTrue:[
+    anObject isByteCollection ifTrue:[
         self nextPutAll:anObject startingAt:start to:(start + count - 1).
         ^ count.
     ].
@@ -615,5 +620,5 @@
 !WriteStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.68 2008-11-06 11:00:25 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.69 2009-07-08 18:01:03 stefan Exp $'
 ! !