PositionableStream.st
changeset 17606 b30bac248329
parent 17559 010577abda05
child 17611 a3d9a43a6197
--- a/PositionableStream.st	Thu Mar 12 18:12:57 2015 +0100
+++ b/PositionableStream.st	Thu Mar 12 18:14:00 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -123,6 +125,7 @@
     "Modified: / 13-07-2006 / 20:36:54 / cg"
 ! !
 
+
 !PositionableStream methodsFor:'Compatibility-Dolphin'!
 
 endChunk
@@ -620,16 +623,20 @@
 !PositionableStream methodsFor:'reading'!
 
 nextAvailable:count
-    |end result|
+    collection notNil ifTrue:[
+        |end result|
 
-    end := position + count.
-    end >= readLimit ifTrue:[
-        end := readLimit.
+        end := position + count.
+        end >= readLimit ifTrue:[
+            end := readLimit.
+        ].
+
+        result := collection copyFrom:position+1 to:end.
+        position := end.
+        ^ result.
     ].
 
-    result := collection copyFrom:position+1 to:end.
-    position := end.
-    ^ result.
+    ^ super nextAvailable:count.
 
     "
         'abc' readStream nextAvailable:1.
@@ -773,11 +780,11 @@
 !PositionableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.169 2015-02-25 14:13:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.170 2015-03-12 17:14:00 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.169 2015-02-25 14:13:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.170 2015-03-12 17:14:00 stefan Exp $'
 ! !