ByteArray.st
branchjv
changeset 17732 a1892eeca6c0
parent 17728 bbc5fa73dfab
child 17734 406b1590afe8
--- a/ByteArray.st	Fri Aug 28 12:38:51 2009 +0100
+++ b/ByteArray.st	Sat Oct 24 16:48:19 2009 +0100
@@ -175,12 +175,31 @@
 
 !ByteArray methodsFor:'Compatibility-Squeak'!
 
+bitXor:aByteArray
+    "return a new byteArray containing the bitWise-xor of the receiver's and the
+     argument's bytes"
+
+    |answer|
+
+    answer := self copy.
+    1 to: self size do: [ :each | 
+        answer at: each put: ((self at: each) bitXor: (aByteArray at: each))
+    ].
+    ^ answer
+!
+
 copyFromByteArray:aByteArray
     "copy as much as possible from aByteArray"
 
     self replaceFrom:1 to:(self size min:aByteArray size) with:aByteArray startingAt:1
 ! !
 
+!ByteArray methodsFor:'Compatibility-VW'!
+
+asByteString
+    ^ self asString
+! !
+
 !ByteArray methodsFor:'accessing'!
 
 basicAt:index
@@ -1017,6 +1036,19 @@
     "
 !
 
+asInteger
+    "convert myself to an integer - the first byte is most significant.
+     This is also in Squeak."
+
+    ^ (LargeInteger digitBytes:self MSB:true) normalize
+
+    "
+        #[ 2 ] asInteger hexPrintString
+        #[ 16r1 16r2 ] asInteger hexPrintString
+        #[4 0 0 0 0 0 0 0] asInteger hexPrintString
+    "
+!
+
 asPackedString
     "ST-80 compatibility: encode the receiver into an ascii String
      with 6bits encoded per character. Each group of 6 bits is encoded
@@ -3129,6 +3161,7 @@
     "
 ! !
 
+
 !ByteArray methodsFor:'searching'!
 
 indexOf:aByte startingAt:start
@@ -3211,5 +3244,10 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ByteArray.st 10467 2009-08-19 16:14:36Z vranyj1 $'
+    ^ '$Id: ByteArray.st 10473 2009-10-24 15:48:19Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.193 2009/10/14 17:29:49 stefan Exp §'
 ! !
+