package j2;

import java.io.ByteArrayOutputStream;

/* JADX INFO: compiled from: Hex.java */
/* JADX INFO: loaded from: classes.dex */
public class b {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final c f5071a = new c();

    public static byte[] a(byte[] bArr) {
        return b(bArr, 0, bArr.length);
    }

    public static byte[] b(byte[] bArr, int i3, int i4) {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        try {
            f5071a.a(bArr, i3, i4, byteArrayOutputStream);
            return byteArrayOutputStream.toByteArray();
        } catch (Exception e3) {
            throw new a("exception encoding Hex string: " + e3.getMessage(), e3);
        }
    }

    public static String c(byte[] bArr) {
        return d(bArr, 0, bArr.length);
    }

    public static String d(byte[] bArr, int i3, int i4) {
        return i2.c.b(b(bArr, i3, i4));
    }
}
