22 lines
840 B
Java
22 lines
840 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.WriterException;
|
|
import com.google.zxing.common.BitMatrix;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class UPCAWriter implements Writer {
|
|
private final EAN13Writer a = new EAN13Writer();
|
|
|
|
@Override // com.google.zxing.Writer
|
|
public BitMatrix a(String str, BarcodeFormat barcodeFormat, int i, int i2, Map<EncodeHintType, ?> map) throws WriterException {
|
|
if (barcodeFormat == BarcodeFormat.UPC_A) {
|
|
return this.a.a("0".concat(String.valueOf(str)), BarcodeFormat.EAN_13, i, i2, map);
|
|
}
|
|
throw new IllegalArgumentException("Can only encode UPC-A, but got ".concat(String.valueOf(barcodeFormat)));
|
|
}
|
|
}
|