package 㿎;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import ᨨ.AbstractC1483;
import ᨨ.C1492;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.㗽  reason: contains not printable characters */
/* compiled from: FormBody */
public final class C2649 extends AbstractC2651 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final C2628 f9007 = C2628.m6937("application/x-www-form-urlencoded");

    /* renamed from: ῲ  reason: contains not printable characters */
    public final List<String> f9008;

    /* renamed from: K  reason: contains not printable characters */
    public final List<String> f9009;

    /* renamed from: 㿎.㗽$K  reason: contains not printable characters */
    /* compiled from: FormBody */
    public static final class C2650 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final Charset f9010 = null;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final List<String> f9011 = new ArrayList();

        /* renamed from: K  reason: contains not printable characters */
        public final List<String> f9012 = new ArrayList();

        /* renamed from: ῲ  reason: contains not printable characters */
        public C2650 m6977(String str, String str2) {
            if (str == null) {
                throw new NullPointerException("name == null");
            } else if (str2 != null) {
                this.f9012.add(C2531.m6588(str, " \"':;<=>@[]^`{}|/\\?#&!$(),~", true, false, true, true, this.f9010));
                this.f9011.add(C2531.m6588(str2, " \"':;<=>@[]^`{}|/\\?#&!$(),~", true, false, true, true, this.f9010));
                return this;
            } else {
                throw new NullPointerException("value == null");
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2650 m6978(String str, String str2) {
            if (str == null) {
                throw new NullPointerException("name == null");
            } else if (str2 != null) {
                this.f9012.add(C2531.m6588(str, " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, false, true, true, this.f9010));
                this.f9011.add(C2531.m6588(str2, " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, false, true, true, this.f9010));
                return this;
            } else {
                throw new NullPointerException("value == null");
            }
        }
    }

    public C2649(List<String> list, List<String> list2) {
        this.f9009 = C2540.m6646(list);
        this.f9008 = C2540.m6646(list2);
    }

    @Override // 㿎.AbstractC2651
    public long contentLength() {
        return m6976(null, true);
    }

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

    @Override // 㿎.AbstractC2651
    public void writeTo(AbstractC1483 r2) throws IOException {
        m6976(r2, false);
    }

    /* renamed from: K  reason: contains not printable characters */
    public final long m6976(AbstractC1483 r4, boolean z) {
        C1492 r42;
        if (z) {
            r42 = new C1492();
        } else {
            r42 = r4.m3731();
        }
        int size = this.f9009.size();
        for (int i = 0; i < size; i++) {
            if (i > 0) {
                r42.writeByte(38);
            }
            r42.m3792(this.f9009.get(i));
            r42.writeByte(61);
            r42.m3792(this.f9008.get(i));
        }
        if (!z) {
            return 0;
        }
        long j = r42.f5529;
        r42.m3773();
        return j;
    }
}
