package q7;

import P6.g;
import x7.A;
import x7.C1731g;
import x7.F;
import x7.J;
import x7.p;

/* JADX INFO: loaded from: classes.dex */
public final class e implements F, AutoCloseable {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final p f16341q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public boolean f16342r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final /* synthetic */ F4.a f16343s;

    public e(F4.a aVar) {
        this.f16343s = aVar;
        this.f16341q = new p(((A) aVar.f2498e).f18721q.f());
    }

    @Override // x7.F
    public final void X(C1731g c1731g, long j8) {
        g.e(c1731g, "source");
        if (this.f16342r) {
            throw new IllegalStateException("closed");
        }
        l7.b.c(c1731g.f18765r, 0L, j8);
        ((A) this.f16343s.f2498e).X(c1731g, j8);
    }

    @Override // x7.F, java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        if (this.f16342r) {
            return;
        }
        this.f16342r = true;
        F4.a aVar = this.f16343s;
        aVar.getClass();
        p pVar = this.f16341q;
        J j8 = pVar.f18779e;
        pVar.f18779e = J.f18740d;
        j8.a();
        j8.b();
        aVar.f2494a = 3;
    }

    @Override // x7.F
    public final J f() {
        return this.f16341q;
    }

    @Override // x7.F, java.io.Flushable
    public final void flush() {
        if (this.f16342r) {
            return;
        }
        ((A) this.f16343s.f2498e).flush();
    }
}
