package jq;

import java.util.Arrays;

/* loaded from: classes3.dex */
public final class k1 extends z0 {

    /* renamed from: a, reason: collision with root package name */
    private byte[] f25228a;

    /* renamed from: b, reason: collision with root package name */
    private int f25229b;

    public /* synthetic */ k1(byte[] bArr, kotlin.jvm.internal.k kVar) {
        this(bArr);
    }

    @Override // jq.z0
    public /* bridge */ /* synthetic */ Object a() {
        return rm.e0.e(f());
    }

    @Override // jq.z0
    public void b(int i10) {
        int d10;
        if (rm.e0.C(this.f25228a) < i10) {
            byte[] bArr = this.f25228a;
            d10 = jn.o.d(i10, rm.e0.C(bArr) * 2);
            byte[] copyOf = Arrays.copyOf(bArr, d10);
            kotlin.jvm.internal.t.f(copyOf, "copyOf(this, newSize)");
            this.f25228a = rm.e0.i(copyOf);
        }
    }

    @Override // jq.z0
    public int d() {
        return this.f25229b;
    }

    public final void e(byte b10) {
        z0.c(this, 0, 1, null);
        byte[] bArr = this.f25228a;
        int d10 = d();
        this.f25229b = d10 + 1;
        rm.e0.G(bArr, d10, b10);
    }

    public byte[] f() {
        byte[] copyOf = Arrays.copyOf(this.f25228a, d());
        kotlin.jvm.internal.t.f(copyOf, "copyOf(this, newSize)");
        return rm.e0.i(copyOf);
    }

    private k1(byte[] bufferWithData) {
        kotlin.jvm.internal.t.g(bufferWithData, "bufferWithData");
        this.f25228a = bufferWithData;
        this.f25229b = rm.e0.C(bufferWithData);
        b(10);
    }
}
