package ඓ.ⁱ.K.ʬ;

import com.qiniu.android.http.CancellationHandler;
import java.io.IOException;
import ඓ.ⁱ.K.㸾.C1277;
import ᨨ.AbstractC1473;
import ᨨ.AbstractC1481;
import ᨨ.AbstractC1483;
import ᨨ.C1486;
import ᨨ.C1492;
import ῲ.ᨨ.㳳.C1841;
import 㿎.AbstractC2651;
import 㿎.C2628;

/* renamed from: ඓ.ⁱ.K.ʬ.ⁱ  reason: contains not printable characters */
/* compiled from: CountingRequestBody */
public final class C1236 extends AbstractC2651 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final long f4876;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final AbstractC1231 f4877;

    /* renamed from: K  reason: contains not printable characters */
    public final AbstractC2651 f4878;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final CancellationHandler f4879;

    /* renamed from: ඓ.ⁱ.K.ʬ.ⁱ$K  reason: contains not printable characters */
    /* compiled from: CountingRequestBody */
    public final class C1237 extends AbstractC1481 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f4880 = 0;

        /* renamed from: ඓ.ⁱ.K.ʬ.ⁱ$K$K  reason: contains not printable characters */
        /* compiled from: CountingRequestBody */
        public class RunnableC1238 implements Runnable {
            public RunnableC1238() {
            }

            public void run() {
                C1237 k = C1237.this;
                C1236 r1 = C1236.this;
                r1.f4877.onProgress((long) k.f4880, r1.f4876);
            }
        }

        public C1237(AbstractC1473 r2) {
            super(r2);
        }

        @Override // ᨨ.AbstractC1481, ᨨ.AbstractC1473
        /* renamed from: K  reason: contains not printable characters */
        public void m3311(C1492 r3, long j) throws IOException {
            C1236 r0 = C1236.this;
            if (r0.f4879 == null && r0.f4877 == null) {
                this.f5510.m3692(r3, j);
                return;
            }
            CancellationHandler cancellationHandler = C1236.this.f4879;
            if (cancellationHandler != null) {
                C1277 r02 = (C1277) cancellationHandler;
            }
            this.f5510.m3692(r3, j);
            this.f4880 = (int) (((long) this.f4880) + j);
            if (C1236.this.f4877 != null) {
                C1841.m4795(new RunnableC1238());
            }
        }
    }

    public C1236(AbstractC2651 r1, AbstractC1231 r2, long j, CancellationHandler cancellationHandler) {
        this.f4878 = r1;
        this.f4877 = r2;
        this.f4876 = j;
        this.f4879 = cancellationHandler;
    }

    @Override // 㿎.AbstractC2651
    public long contentLength() throws IOException {
        return this.f4878.contentLength();
    }

    @Override // 㿎.AbstractC2651
    public C2628 contentType() {
        return this.f4878.contentType();
    }

    @Override // 㿎.AbstractC2651
    public void writeTo(AbstractC1483 r2) throws IOException {
        AbstractC1483 r22 = C1486.m3737(new C1237(r2));
        this.f4878.writeTo(r22);
        r22.flush();
    }
}
