package j.k0;

import java.lang.reflect.Array;

/* JADX INFO: compiled from: ArraysJVM.kt */
/* JADX INFO: loaded from: classes.dex */
class g {
    public static final <T> T[] a(T[] tArr, int i2) {
        j.p0.d.r.f(tArr, "reference");
        Object objNewInstance = Array.newInstance(tArr.getClass().getComponentType(), i2);
        j.p0.d.r.d(objNewInstance, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.arrayOfNulls>");
        return (T[]) ((Object[]) objNewInstance);
    }

    public static final void b(int i2, int i3) {
        if (i2 <= i3) {
            return;
        }
        throw new IndexOutOfBoundsException("toIndex (" + i2 + ") is greater than size (" + i3 + ").");
    }
}
