Stream.st
changeset 19571 1bf42824967f
parent 19569 b6569649c8a5
child 19572 90f8a4a7060a
child 19604 db92dc60b19d
--- a/Stream.st	Tue Apr 12 13:03:27 2016 +0200
+++ b/Stream.st	Tue Apr 12 18:43:17 2016 +0200
@@ -275,8 +275,6 @@
     "Modified: 10.1.1996 / 19:39:19 / cg"
 ! !
 
-
-
 !Stream methodsFor:'accessing'!
 
 contents
@@ -1778,6 +1776,24 @@
 
 !Stream methodsFor:'non homogenous writing'!
 
+next:count putByte:aByteValue
+    "write a byte n times"
+
+    |n "{ Class: SmallInteger }"|
+
+    n := count.
+    n timesRepeat:[self nextPutByte:aByteValue].
+
+    "
+     |s|
+     s := ByteArray new writeStream.
+     s nextPutByte:1.
+     s next:10 putByte:99.
+     s nextPutByte:2.
+     s contents
+    "
+!
+
 nextNumber:n put:v 
     "Append to the receiver the argument, v, which is a positive Integer,
      as the next n bytes. Bytes are written msb first.