--- a/ByteArray.st Tue Jul 12 06:40:09 2016 +0200
+++ b/ByteArray.st Wed Jul 13 07:01:16 2016 +0200
@@ -1205,6 +1205,25 @@
"
!
+asString
+ "speed up string conversions"
+
+ |size cls|
+
+ cls := self class.
+
+ (cls == ByteArray or:[cls == ImmutableByteArray]) ifTrue:[
+ size := self size.
+ ^ (String uninitializedNew:size) replaceBytesFrom:1 to:size with:self startingAt:1.
+ ].
+ ^ super asString.
+
+ "
+ #[16r41 16r42 16r43] asString
+ #[16r41 16r42 16r43] asImmutableByteArray asString
+ "
+!
+
beImmutable
"make myself write-protected"