--- a/ByteArray.st Fri Dec 19 09:35:37 1997 +0100
+++ b/ByteArray.st Fri Dec 19 09:38:43 1997 +0100
@@ -85,47 +85,47 @@
sz := aString size.
sz == 0 ifTrue:[^ self new].
stop := sz // 4 * 3.
- "the size modulu 3 is encoded in the last character, if its in the
+ "the size modulo 3 is encoded in the last character, if its in the
range 97 .. otherwise, its exact."
lastCharacter := aString last.
lastCharacter asciiValue > 96 ifTrue:[
- stop := stop - 3 + lastCharacter asciiValue - 96
+ stop := stop - 3 + lastCharacter asciiValue - 96
].
bytes := self new:stop.
index := 1. dstIndex := 1.
[dstIndex <= stop] whileTrue:[
- "take 4 characters ..."
- sixBits := (aString at:index) asciiValue.
- sixBits := sixBits bitAnd:16r3F.
- n := sixBits.
+ "take 4 characters ..."
+ sixBits := (aString at:index) asciiValue.
+ sixBits := sixBits bitAnd:16r3F.
+ n := sixBits.
- sixBits := (aString at:index+1) asciiValue.
- sixBits := sixBits bitAnd:16r3F.
- n := (n bitShift:6) + sixBits.
+ sixBits := (aString at:index+1) asciiValue.
+ sixBits := sixBits bitAnd:16r3F.
+ n := (n bitShift:6) + sixBits.
- sixBits := (aString at:index+2) asciiValue.
- sixBits := sixBits bitAnd:16r3F.
- n := (n bitShift:6) + sixBits.
+ sixBits := (aString at:index+2) asciiValue.
+ sixBits := sixBits bitAnd:16r3F.
+ n := (n bitShift:6) + sixBits.
- sixBits := (aString at:index+3) asciiValue.
- sixBits := sixBits bitAnd:16r3F.
- n := (n bitShift:6) + sixBits.
+ sixBits := (aString at:index+3) asciiValue.
+ sixBits := sixBits bitAnd:16r3F.
+ n := (n bitShift:6) + sixBits.
- index := index + 4.
+ index := index + 4.
- "/ now have 24 bits in n
+ "/ now have 24 bits in n
- bytes at:dstIndex put:(n bitShift:-16).
+ bytes at:dstIndex put:(n bitShift:-16).
- dstIndex < stop ifTrue:[
- bytes at:dstIndex+1 put:((n bitShift:-8) bitAnd:16rFF).
- dstIndex+2 <= stop ifTrue:[
- bytes at:dstIndex+2 put:(n bitAnd:16rFF).
- ]
- ].
- dstIndex := dstIndex + 3.
+ dstIndex < stop ifTrue:[
+ bytes at:dstIndex+1 put:((n bitShift:-8) bitAnd:16rFF).
+ dstIndex+2 <= stop ifTrue:[
+ bytes at:dstIndex+2 put:(n bitAnd:16rFF).
+ ]
+ ].
+ dstIndex := dstIndex + 3.
].
^ bytes
@@ -138,7 +138,8 @@
"
- "Modified: 6.3.1997 / 15:28:52 / cg"
+ "Modified: / 6.3.1997 / 15:28:52 / cg"
+ "Modified: / 18.12.1997 / 17:17:11 / stefan"
!
uninitializedNew:anInteger
@@ -2382,5 +2383,5 @@
!ByteArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.89 1997-11-02 17:13:57 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.90 1997-12-19 08:37:05 stefan Exp $'
! !