package kotlin.reflect.jvm.internal.impl.protobuf;

import java.util.NoSuchElementException;
import kotlin.reflect.jvm.internal.impl.protobuf.d;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public class c extends o {

    /* renamed from: s, reason: collision with root package name */
    private final int f26238s;

    /* renamed from: t, reason: collision with root package name */
    private final int f26239t;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes3.dex */
    public class b implements d.a {

        /* renamed from: p, reason: collision with root package name */
        private int f26240p;

        /* renamed from: q, reason: collision with root package name */
        private final int f26241q;

        @Override // java.util.Iterator
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public Byte next() {
            return Byte.valueOf(nextByte());
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f26240p < this.f26241q;
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.d.a
        public byte nextByte() {
            int i10 = this.f26240p;
            if (i10 >= this.f26241q) {
                throw new NoSuchElementException();
            }
            byte[] bArr = c.this.f26304q;
            this.f26240p = i10 + 1;
            return bArr[i10];
        }

        @Override // java.util.Iterator
        public void remove() {
            throw new UnsupportedOperationException();
        }

        private b() {
            int H = c.this.H();
            this.f26240p = H;
            this.f26241q = H + c.this.size();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public c(byte[] bArr, int i10, int i11) {
        super(bArr);
        if (i10 < 0) {
            StringBuilder sb2 = new StringBuilder(29);
            sb2.append("Offset too small: ");
            sb2.append(i10);
            throw new IllegalArgumentException(sb2.toString());
        }
        if (i11 < 0) {
            StringBuilder sb3 = new StringBuilder(29);
            sb3.append("Length too small: ");
            sb3.append(i10);
            throw new IllegalArgumentException(sb3.toString());
        }
        if (i10 + i11 <= bArr.length) {
            this.f26238s = i10;
            this.f26239t = i11;
            return;
        }
        StringBuilder sb4 = new StringBuilder(48);
        sb4.append("Offset+Length too large: ");
        sb4.append(i10);
        sb4.append("+");
        sb4.append(i11);
        throw new IllegalArgumentException(sb4.toString());
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.o
    protected int H() {
        return this.f26238s;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.o, java.lang.Iterable
    /* renamed from: J */
    public d.a iterator() {
        return new b();
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // kotlin.reflect.jvm.internal.impl.protobuf.o, kotlin.reflect.jvm.internal.impl.protobuf.d
    public void o(byte[] bArr, int i10, int i11, int i12) {
        System.arraycopy(this.f26304q, H() + i10, bArr, i11, i12);
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.o, kotlin.reflect.jvm.internal.impl.protobuf.d
    public int size() {
        return this.f26239t;
    }
}
