ByteArray.st
changeset 5900 3c3aba588e94
parent 5554 28520e96cca9
child 5901 1daf5691152a
--- a/ByteArray.st	Thu Aug 02 11:52:38 2001 +0200
+++ b/ByteArray.st	Wed Aug 08 17:15:04 2001 +0200
@@ -1139,6 +1139,23 @@
     "
 !
 
+asString
+    "speed up string conversions"
+
+    |size|
+
+    ^ self class == ByteArray ifTrue:[
+        size := self size.
+        (String new:size) replaceBytesFrom:1 to:size with:self startingAt:1.
+    ] ifFalse:[
+        super asString
+    ]
+
+    "
+      #[60 61 62 63] asString
+    "
+!
+
 decodeAsLiteralArray
     "given a literalEncoding in the receiver,
      create & return the corresponding object.
@@ -3179,5 +3196,5 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.142 2000-08-22 13:46:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.143 2001-08-08 15:15:04 stefan Exp $'
 ! !