package x7;

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

/* JADX INFO: loaded from: classes.dex */
public final class z extends OutputStream implements AutoCloseable {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ A f18805q;

    public z(A a3) {
        this.f18805q = a3;
    }

    @Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
    public final void close() throws Throwable {
        this.f18805q.close();
    }

    @Override // java.io.OutputStream, java.io.Flushable
    public final void flush() {
        A a3 = this.f18805q;
        if (a3.f18723s) {
            return;
        }
        a3.flush();
    }

    public final String toString() {
        return this.f18805q + ".outputStream()";
    }

    @Override // java.io.OutputStream
    public final void write(int i) throws IOException {
        A a3 = this.f18805q;
        if (a3.f18723s) {
            throw new IOException("closed");
        }
        a3.f18722r.u0((byte) i);
        a3.a();
    }

    @Override // java.io.OutputStream
    public final void write(byte[] bArr, int i, int i5) throws IOException {
        P6.g.e(bArr, "data");
        A a3 = this.f18805q;
        if (!a3.f18723s) {
            a3.f18722r.s0(bArr, i, i5);
            a3.a();
            return;
        }
        throw new IOException("closed");
    }
}
