Rabbit-R1/switch port/java/sources/com/google/zxing/oned/UPCAWriter.java
2024-05-21 17:08:36 -04:00

25 lines
993 B
Java

package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.Writer;
import com.google.zxing.common.BitMatrix;
import java.util.Map;
/* loaded from: classes3.dex */
public final class UPCAWriter implements Writer {
private final EAN13Writer subWriter = new EAN13Writer();
@Override // com.google.zxing.Writer
public BitMatrix encode(String str, BarcodeFormat barcodeFormat, int i, int i2) {
return encode(str, barcodeFormat, i, i2, null);
}
@Override // com.google.zxing.Writer
public BitMatrix encode(String str, BarcodeFormat barcodeFormat, int i, int i2, Map<EncodeHintType, ?> map) {
if (barcodeFormat != BarcodeFormat.UPC_A) {
throw new IllegalArgumentException("Can only encode UPC-A, but got ".concat(String.valueOf(barcodeFormat)));
}
return this.subWriter.encode("0".concat(String.valueOf(str)), BarcodeFormat.EAN_13, i, i2, map);
}
}