class: CompressionStream
authorClaus Gittinger <cg@exept.de>
Wed, 21 Aug 2013 02:00:54 +0200
changeset 3099 6ec8d8a4dae4
parent 3098 2ae8f1b57bc1
child 3100 3d1aed95bc8e
class: CompressionStream added: #nextByte changed: #next
CompressionStream.st
--- a/CompressionStream.st	Tue Aug 20 14:14:23 2013 +0200
+++ b/CompressionStream.st	Wed Aug 21 02:00:54 2013 +0200
@@ -446,13 +446,10 @@
 
     |byte|
 
-    self canReadWithoutBlocking ifFalse:[
-	"there is no more element; the stream is at end"
-	^ nil
+    (byte := self nextByte) isNil ifTrue:[
+        "there is no more element; the stream is at end"
+        ^ nil
     ].
-    position := position + 1.
-    byte := outputBytes at:position.
-
     binary ifTrue:[^ byte ].
     ^ Character value:byte
 !
@@ -500,6 +497,22 @@
     ^ n - remaining
 !
 
+nextByte
+    "return the next element, a byte 
+     return nil, if there are no more elements"
+
+    |byte|
+
+    self canReadWithoutBlocking ifFalse:[
+        "there is no more element; the stream is at end"
+        ^ nil
+    ].
+    position := position + 1.
+    byte := outputBytes at:position.
+
+    ^ byte.
+!
+
 skip:count
     "skip count objects, return the receiver
      redefined for optimization"
@@ -654,11 +667,12 @@
 !CompressionStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.30 2010-08-08 12:40:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.31 2013-08-21 00:00:54 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.30 2010-08-08 12:40:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.31 2013-08-21 00:00:54 cg Exp $'
 ! !
 
+
 CompressionStream initialize!