package m4;

import java.io.IOException;
import java.io.OutputStream;

/* JADX INFO: renamed from: m4.e1, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C2502e1 extends OutputStream {

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

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

    public /* synthetic */ C2502e1(Object obj, int i6) {
        this.f20992a = i6;
        this.f20993b = obj;
    }

    @Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
    public void close() throws Throwable {
        switch (this.f20992a) {
            case 1:
                ((p5.I) this.f20993b).close();
                break;
            default:
                super.close();
                break;
        }
    }

    @Override // java.io.OutputStream, java.io.Flushable
    public void flush() throws IOException {
        switch (this.f20992a) {
            case 1:
                p5.I i6 = (p5.I) this.f20993b;
                if (!i6.f23057c) {
                    i6.flush();
                }
                break;
            default:
                super.flush();
                break;
        }
    }

    public String toString() {
        switch (this.f20992a) {
            case 1:
                return ((p5.I) this.f20993b) + ".outputStream()";
            default:
                return super.toString();
        }
    }

    @Override // java.io.OutputStream
    public final void write(int i6) throws IOException {
        switch (this.f20992a) {
            case 0:
                write(new byte[]{(byte) i6}, 0, 1);
                return;
            default:
                p5.I i7 = (p5.I) this.f20993b;
                if (i7.f23057c) {
                    throw new IOException("closed");
                }
                i7.f23056b.Q((byte) i6);
                i7.a();
                return;
        }
    }

    @Override // java.io.OutputStream
    public final void write(byte[] data, int i6, int i7) throws IOException {
        switch (this.f20992a) {
            case 0:
                ((C2505f1) this.f20993b).h(data, i6, i7);
                return;
            default:
                kotlin.jvm.internal.o.h(data, "data");
                p5.I i8 = (p5.I) this.f20993b;
                if (!i8.f23057c) {
                    i8.f23056b.P(data, i6, i7);
                    i8.a();
                    return;
                }
                throw new IOException("closed");
        }
    }
}
