package h5; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /* loaded from: classes2.dex */ public final class u extends k0 { /* renamed from: c, reason: collision with root package name */ private static final e0 f10294c = e0.b("application/x-www-form-urlencoded"); /* renamed from: a, reason: collision with root package name */ private final List f10295a; /* renamed from: b, reason: collision with root package name */ private final List f10296b; public static final class a { /* renamed from: a, reason: collision with root package name */ private final List f10297a; /* renamed from: b, reason: collision with root package name */ private final List f10298b; /* renamed from: c, reason: collision with root package name */ private final Charset f10299c; public a() { this(null); } public a a(String str, String str2) { if (str == null) { throw new NullPointerException("name == null"); } if (str2 == null) { throw new NullPointerException("value == null"); } this.f10297a.add(b0.d(str, " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, false, true, true, this.f10299c)); this.f10298b.add(b0.d(str2, " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, false, true, true, this.f10299c)); return this; } public u b() { return new u(this.f10297a, this.f10298b); } public a(Charset charset) { this.f10297a = new ArrayList(); this.f10298b = new ArrayList(); this.f10299c = charset; } } u(List list, List list2) { this.f10295a = i5.c.t(list); this.f10296b = i5.c.t(list2); } private long f(e eVar, boolean z10) { d dVar = z10 ? new d() : eVar.a(); int size = this.f10295a.size(); for (int i10 = 0; i10 < size; i10++) { if (i10 > 0) { dVar.h(38); } dVar.j((String) this.f10295a.get(i10)); dVar.h(61); dVar.j((String) this.f10296b.get(i10)); } if (!z10) { return 0L; } long u02 = dVar.u0(); dVar.P(); return u02; } @Override // h5.k0 public long a() { return f(null, true); } @Override // h5.k0 public e0 b() { return f10294c; } @Override // h5.k0 public void e(e eVar) { f(eVar, false); } }