ByteArray.st
branchjv
changeset 17742 3fef0ed4c2d5
parent 17735 6a5bc05f696a
child 17751 b2273fa8d59f
--- a/ByteArray.st	Sun Dec 27 19:45:23 2009 +0000
+++ b/ByteArray.st	Sun Dec 27 20:16:54 2009 +0000
@@ -1056,6 +1056,20 @@
     "
 !
 
+asIntegerMSB:isMSBFirst
+    "convert myself to an integer - the first byte is most significant.
+     This is also in Squeak."
+
+    ^ (LargeInteger digitBytes:self MSB:isMSBFirst) normalize
+
+    "
+        (#[ 2 ] asIntegerMSB:true) hexPrintString
+        (#[ 16r1 16r2 ] asIntegerMSB:true) hexPrintString
+        (#[ 16r1 16r2 ] asIntegerMSB:false) hexPrintString
+        (#[4 0 0 0 0 0 0 0] asIntegerMSB:true) hexPrintString
+    "
+!
+
 asPackedString
     "ST-80 compatibility: encode the receiver into an ascii String
      with 6bits encoded per character. Each group of 6 bits is encoded
@@ -3264,12 +3278,13 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ByteArray.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ByteArray.st 10489 2009-12-27 20:16:54Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.197 2009/11/17 13:29:37 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.198 2009/12/15 21:35:21 stefan Exp §'
 ! !
 
 
 
+