package okhttp3.internal.cache;

import J4.c;
import java.io.EOFException;
import java.io.IOException;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import p5.C2740j;
import p5.N;
import p5.v;

/* JADX INFO: loaded from: classes3.dex */
public class FaultHidingSink extends v {

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public FaultHidingSink(N delegate, c cVar) {
        super(delegate);
        o.h(delegate, "delegate");
        this.f22259a = (p) cVar;
    }

    /* JADX WARN: Type inference failed for: r1v1, types: [J4.c, kotlin.jvm.internal.p] */
    @Override // p5.v, p5.N, java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        if (this.f22260b) {
            return;
        }
        try {
            super.close();
        } catch (IOException e6) {
            this.f22260b = true;
            this.f22259a.invoke(e6);
        }
    }

    /* JADX WARN: Type inference failed for: r1v1, types: [J4.c, kotlin.jvm.internal.p] */
    @Override // p5.v, p5.N, java.io.Flushable
    public final void flush() {
        if (this.f22260b) {
            return;
        }
        try {
            super.flush();
        } catch (IOException e6) {
            this.f22260b = true;
            this.f22259a.invoke(e6);
        }
    }

    /* JADX WARN: Type inference failed for: r3v2, types: [J4.c, kotlin.jvm.internal.p] */
    @Override // p5.v, p5.N
    public final void write(C2740j source, long j4) throws EOFException {
        o.h(source, "source");
        if (this.f22260b) {
            source.J(j4);
            return;
        }
        try {
            super.write(source, j4);
        } catch (IOException e6) {
            this.f22260b = true;
            this.f22259a.invoke(e6);
        }
    }
}
