package i2;

import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: compiled from: Arrays.java */
/* JADX INFO: loaded from: classes.dex */
public final class a {

    /* JADX INFO: renamed from: i2.a$a, reason: collision with other inner class name */
    /* JADX INFO: compiled from: Arrays.java */
    public static class C0067a<T> implements Iterator<T> {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private final T[] f4858e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private int f4859f = 0;

        public C0067a(T[] tArr) {
            this.f4858e = tArr;
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f4859f < this.f4858e.length;
        }

        @Override // java.util.Iterator
        public T next() {
            int i3 = this.f4859f;
            T[] tArr = this.f4858e;
            if (i3 != tArr.length) {
                this.f4859f = i3 + 1;
                return tArr[i3];
            }
            throw new NoSuchElementException("Out of elements: " + this.f4859f);
        }

        @Override // java.util.Iterator
        public void remove() {
            throw new UnsupportedOperationException("Cannot remove element from an Array.");
        }
    }

    public static boolean a(byte[] bArr, byte[] bArr2) {
        return Arrays.equals(bArr, bArr2);
    }

    public static boolean b(char[] cArr, char[] cArr2) {
        return Arrays.equals(cArr, cArr2);
    }

    public static byte[] c(byte[] bArr) {
        if (bArr == null) {
            return null;
        }
        return (byte[]) bArr.clone();
    }

    public static int d(byte[] bArr) {
        if (bArr == null) {
            return 0;
        }
        int length = bArr.length;
        int i3 = length + 1;
        while (true) {
            length--;
            if (length < 0) {
                return i3;
            }
            i3 = (i3 * 257) ^ bArr[length];
        }
    }

    public static int e(byte[] bArr, int i3, int i4) {
        if (bArr == null) {
            return 0;
        }
        int i5 = i4 + 1;
        while (true) {
            i4--;
            if (i4 < 0) {
                return i5;
            }
            i5 = (i5 * 257) ^ bArr[i3 + i4];
        }
    }

    public static int f(char[] cArr) {
        if (cArr == null) {
            return 0;
        }
        int length = cArr.length;
        int i3 = length + 1;
        while (true) {
            length--;
            if (length < 0) {
                return i3;
            }
            i3 = (i3 * 257) ^ cArr[length];
        }
    }
}
