#DOCUMENTATION by cg
class: BitArray
comment/format in:
#at:
#at:put:
#atAllPut:
--- a/BitArray.st Mon Jun 03 08:19:34 2019 +0200
+++ b/BitArray.st Mon Jun 03 08:21:38 2019 +0200
@@ -187,6 +187,11 @@
].
i0 := index - 1.
byte := super basicAt:(i0 // 8)+1.
+ "/ ATTENTION:
+ "/ Bits 1 to 8 of the BooleanArray are stored in bits 8 to 1 of the
+ "/ corresponding byte, to allow easy mapping to ASN.1 BIT STRING encoding
+ "/ in the BER. (i.e. MSB-first)
+ "/ Do not change this.
mask := 1 bitShift:(7 - (i0 \\ 8)).
^ (byte bitTest:mask) ifTrue:[1] ifFalse:[0]
@@ -202,6 +207,8 @@
b at:555 put:1.
b at:555
"
+
+ "Modified (comment): / 03-06-2019 / 08:20:20 / Claus Gittinger"
!
at:index put:aNumber
@@ -217,6 +224,11 @@
i0 := index - 1.
idx := (i0 // 8) + 1.
byte := super basicAt:idx.
+ "/ ATTENTION:
+ "/ Bits 1 to 8 of the BooleanArray are stored in bits 8 to 1 of the
+ "/ corresponding byte, to allow easy mapping to ASN.1 BIT STRING encoding
+ "/ in the BER. (i.e. MSB-first)
+ "/ Do not change this.
mask := 1 bitShift:(7 - (i0 \\ 8)).
aNumber == 1 ifTrue:[
byte := byte bitOr:mask
@@ -238,6 +250,8 @@
b at:555 put:1.
b at:555
"
+
+ "Modified (comment): / 03-06-2019 / 08:20:26 / Claus Gittinger"
!
byteAt:index
@@ -335,6 +349,11 @@
].
"/ ensure 0-bits above tally
+ "/ ATTENTION:
+ "/ Bits 1 to 8 of the BooleanArray are stored in bits 8 to 1 of the
+ "/ corresponding byte, to allow easy mapping to ASN.1 BIT STRING encoding
+ "/ in the BER. (i.e. MSB-first)
+ "/ Do not change this.
v := #[ 2r11111111
2r10000000
2r11000000
@@ -350,7 +369,7 @@
((self new:8) atAllPut:1) countOnes
"
- "Modified (format): / 03-06-2019 / 08:18:38 / Claus Gittinger"
+ "Modified (comment): / 03-06-2019 / 08:21:05 / Claus Gittinger"
! !
!BitArray methodsFor:'logical operations'!