package p461;

import java.io.IOException;
import java.io.OutputStream;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ޑ.ލ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C7118 implements InterfaceC7127 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final OutputStream f20655;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final C7130 f20656;

    public C7118(OutputStream outputStream, C7130 c7130) {
        if (outputStream == null) {
            C6635.m9824("out");
            throw null;
        }
        if (c7130 == null) {
            C6635.m9824("timeout");
            throw null;
        }
        this.f20655 = outputStream;
        this.f20656 = c7130;
    }

    @Override // p461.InterfaceC7127, java.io.Closeable, java.lang.AutoCloseable
    public void close() throws IOException {
        this.f20655.close();
    }

    @Override // p461.InterfaceC7127, java.io.Flushable
    public void flush() throws IOException {
        this.f20655.flush();
    }

    public String toString() {
        StringBuilder sbM4889 = C2803.m4889("sink(");
        sbM4889.append(this.f20655);
        sbM4889.append(')');
        return sbM4889.toString();
    }

    @Override // p461.InterfaceC7127
    /* JADX INFO: renamed from: ֏ */
    public void mo10205(C7103 c7103, long j) throws IOException {
        if (c7103 == null) {
            C6635.m9824("source");
            throw null;
        }
        C4303.m7086(c7103.f20630, 0L, j);
        while (j > 0) {
            this.f20656.mo10464();
            C7123 c7123 = c7103.f20629;
            if (c7123 == null) {
                C6635.m9822();
                throw null;
            }
            int iMin = (int) Math.min(j, c7123.f20667 - c7123.f20666);
            this.f20655.write(c7123.f20665, c7123.f20666, iMin);
            int i = c7123.f20666 + iMin;
            c7123.f20666 = i;
            long j2 = iMin;
            j -= j2;
            c7103.f20630 -= j2;
            if (i == c7123.f20667) {
                c7103.f20629 = c7123.m10475();
                C7125.f20674.m10480(c7123);
            }
        }
    }

    @Override // p461.InterfaceC7127
    /* JADX INFO: renamed from: ށ */
    public C7130 mo10278() {
        return this.f20656;
    }
}
