package h2;

import java.io.IOException;
import x7.C1731g;
import x7.F;
import x7.n;

/* JADX INFO: loaded from: classes.dex */
public final class g extends n {

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final B6.a f13389r;

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

    public g(F f3, B6.a aVar) {
        super(f3);
        this.f13389r = aVar;
    }

    @Override // x7.n, x7.F
    public final void X(C1731g c1731g, long j8) throws Exception {
        if (this.f13390s) {
            c1731g.y(j8);
            return;
        }
        try {
            super.X(c1731g, j8);
        } catch (IOException e8) {
            this.f13390s = true;
            this.f13389r.b(e8);
        }
    }

    @Override // x7.n, x7.F, java.io.Closeable, java.lang.AutoCloseable
    public final void close() throws Exception {
        try {
            super.close();
        } catch (IOException e8) {
            this.f13390s = true;
            this.f13389r.b(e8);
        }
    }

    @Override // x7.n, x7.F, java.io.Flushable
    public final void flush() throws Exception {
        try {
            super.flush();
        } catch (IOException e8) {
            this.f13390s = true;
            this.f13389r.b(e8);
        }
    }
}
