Rabbit-R1/android (non root)/java/sources/com/google/zxing/aztec/encoder/BinaryShiftToken.java

46 lines
1.5 KiB
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package com.google.zxing.aztec.encoder;
import com.google.zxing.common.BitArray;
import kotlin.text.Typography;
/* loaded from: classes3.dex */
final class BinaryShiftToken extends Token {
private final short binaryShiftByteCount;
private final short binaryShiftStart;
/* JADX INFO: Access modifiers changed from: package-private */
public BinaryShiftToken(Token token, int i, int i2) {
super(token);
this.binaryShiftStart = (short) i;
this.binaryShiftByteCount = (short) i2;
}
@Override // com.google.zxing.aztec.encoder.Token
public void appendTo(BitArray bitArray, byte[] bArr) {
int i = 0;
while (true) {
short s = this.binaryShiftByteCount;
if (i >= s) {
return;
}
if (i == 0 || (i == 31 && s <= 62)) {
bitArray.appendBits(31, 5);
short s2 = this.binaryShiftByteCount;
if (s2 > 62) {
bitArray.appendBits(s2 - 31, 16);
} else if (i == 0) {
bitArray.appendBits(Math.min((int) s2, 31), 5);
} else {
bitArray.appendBits(s2 - 31, 5);
}
}
bitArray.appendBits(bArr[this.binaryShiftStart + i], 8);
i++;
}
}
public String toString() {
return "<" + ((int) this.binaryShiftStart) + "::" + ((this.binaryShiftStart + this.binaryShiftByteCount) - 1) + Typography.greater;
}
}