package defpackage;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/* renamed from: ᵟʽᵭ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3018 implements InterfaceC3226 {

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public int f11625;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int f11626;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public int f11627;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final InterfaceC4777 f11628;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public int f11629;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public int f11630;

    public C3018(InterfaceC4777 interfaceC4777) {
        this.f11628 = interfaceC4777;
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
    }

    @Override // defpackage.InterfaceC3226
    /* renamed from: ᵝᵵᵺ */
    public final C3948 mo2227() {
        return this.f11628.mo2227();
    }

    @Override // defpackage.InterfaceC3226
    /* renamed from: ᵳٴᵶ */
    public final long mo2229(C0963 c0963, long j) throws IOException {
        int i;
        int i2;
        do {
            int i3 = this.f11627;
            InterfaceC4777 interfaceC4777 = this.f11628;
            if (i3 == 0) {
                interfaceC4777.skip(this.f11625);
                this.f11625 = 0;
                if ((this.f11630 & 4) == 0) {
                    i = this.f11629;
                    int iM4173 = AbstractC1348.m4173(interfaceC4777);
                    this.f11627 = iM4173;
                    this.f11626 = iM4173;
                    int i4 = interfaceC4777.readByte() & 255;
                    this.f11630 = interfaceC4777.readByte() & 255;
                    Logger logger = C4221.f15815;
                    if (logger.isLoggable(Level.FINE)) {
                        C2185 c2185 = AbstractC5398.f20229;
                        logger.fine(AbstractC5398.m11057(true, this.f11629, this.f11626, i4, this.f11630));
                    }
                    i2 = interfaceC4777.readInt() & Integer.MAX_VALUE;
                    this.f11629 = i2;
                    if (i4 != 9) {
                        throw new IOException(i4 + " != TYPE_CONTINUATION");
                    }
                }
            } else {
                long jMo2229 = interfaceC4777.mo2229(c0963, Math.min(8192L, i3));
                if (jMo2229 != -1) {
                    this.f11627 -= (int) jMo2229;
                    return jMo2229;
                }
            }
            return -1L;
        } while (i2 == i);
        C0910.m3045("TYPE_CONTINUATION streamId changed");
        return 0L;
    }
}
