package m4;

import java.io.IOException;
import k4.C2407u;
import n4.C2625c;

/* JADX INFO: loaded from: classes3.dex */
public abstract class D implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f20582a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f20583b;

    public /* synthetic */ D(Object obj, int i6) {
        this.f20582a = i6;
        this.f20583b = obj;
    }

    public abstract void a();

    public abstract void b();

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f20582a) {
            case 0:
                C2407u c2407u = (C2407u) this.f20583b;
                C2407u c2407uA = c2407u.a();
                try {
                    b();
                    return;
                } finally {
                    c2407u.c(c2407uA);
                }
            default:
                C2625c c2625c = (C2625c) this.f20583b;
                try {
                    if (c2625c.l == null) {
                        throw new IOException("Unable to perform write due to unavailable sink.");
                    }
                    a();
                    return;
                } catch (Exception e6) {
                    c2625c.f21630d.p(e6);
                    return;
                }
        }
    }
}
