54 lines
2.0 KiB
Java
54 lines
2.0 KiB
Java
package com.google.zxing.oned;
|
|
|
|
import com.google.zxing.BarcodeFormat;
|
|
import com.google.zxing.BinaryBitmap;
|
|
import com.google.zxing.ChecksumException;
|
|
import com.google.zxing.DecodeHintType;
|
|
import com.google.zxing.FormatException;
|
|
import com.google.zxing.NotFoundException;
|
|
import com.google.zxing.Result;
|
|
import com.google.zxing.common.BitArray;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class UPCAReader extends UPCEANReader {
|
|
private final UPCEANReader i = new EAN13Reader();
|
|
|
|
@Override // com.google.zxing.oned.UPCEANReader
|
|
public Result a(int i, BitArray bitArray, int[] iArr, Map<DecodeHintType, ?> map) throws NotFoundException, FormatException, ChecksumException {
|
|
return a(this.i.a(i, bitArray, iArr, map));
|
|
}
|
|
|
|
@Override // com.google.zxing.oned.UPCEANReader, com.google.zxing.oned.OneDReader
|
|
public Result a(int i, BitArray bitArray, Map<DecodeHintType, ?> map) throws NotFoundException, FormatException, ChecksumException {
|
|
return a(this.i.a(i, bitArray, map));
|
|
}
|
|
|
|
@Override // com.google.zxing.oned.OneDReader, com.google.zxing.Reader
|
|
public Result a(BinaryBitmap binaryBitmap, Map<DecodeHintType, ?> map) throws NotFoundException, FormatException {
|
|
return a(this.i.a(binaryBitmap, map));
|
|
}
|
|
|
|
@Override // com.google.zxing.oned.UPCEANReader
|
|
BarcodeFormat a() {
|
|
return BarcodeFormat.UPC_A;
|
|
}
|
|
|
|
@Override // com.google.zxing.oned.UPCEANReader
|
|
protected int a(BitArray bitArray, int[] iArr, StringBuilder sb) throws NotFoundException {
|
|
return this.i.a(bitArray, iArr, sb);
|
|
}
|
|
|
|
private static Result a(Result result) throws FormatException {
|
|
String e = result.e();
|
|
if (e.charAt(0) == '0') {
|
|
Result result2 = new Result(e.substring(1), null, result.d(), BarcodeFormat.UPC_A);
|
|
if (result.c() != null) {
|
|
result2.a(result.c());
|
|
}
|
|
return result2;
|
|
}
|
|
throw FormatException.getFormatInstance();
|
|
}
|
|
}
|