discord-jadx/app/src/main/java/f0/u.java

85 lines
2.2 KiB
Java
Raw Normal View History

2021-06-27 20:44:35 +00:00
package f0;
2021-11-08 18:25:28 +00:00
import androidx.browser.trusted.sharing.ShareTarget;
import d0.z.d.m;
import f0.e0.c;
import g0.e;
2021-06-27 20:44:35 +00:00
import java.io.IOException;
2021-11-08 18:25:28 +00:00
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.BufferedSink;
/* compiled from: FormBody.kt */
public final class u extends RequestBody {
public static final MediaType a = MediaType.a.a(ShareTarget.ENCODING_TYPE_URL_ENCODED);
2021-12-21 23:37:30 +00:00
/* renamed from: b reason: collision with root package name */
2022-02-14 21:43:51 +00:00
public final List<String> f3656b;
2021-12-21 23:37:30 +00:00
public final List<String> c;
2021-11-08 18:25:28 +00:00
/* compiled from: FormBody.kt */
public static final class a {
public final List<String> a = new ArrayList();
2021-12-21 23:37:30 +00:00
/* renamed from: b reason: collision with root package name */
2022-02-14 21:43:51 +00:00
public final List<String> f3657b = new ArrayList();
2021-12-21 23:37:30 +00:00
public final Charset c = null;
2021-11-08 18:25:28 +00:00
}
static {
2021-12-21 23:37:30 +00:00
MediaType.a aVar = MediaType.c;
2021-11-08 18:25:28 +00:00
}
public u(List<String> list, List<String> list2) {
m.checkParameterIsNotNull(list, "encodedNames");
m.checkParameterIsNotNull(list2, "encodedValues");
2022-02-14 21:43:51 +00:00
this.f3656b = c.z(list);
2021-12-21 23:37:30 +00:00
this.c = c.z(list2);
2021-11-08 18:25:28 +00:00
}
public final long a(BufferedSink bufferedSink, boolean z2) {
e eVar;
if (z2) {
eVar = new e();
} else {
if (bufferedSink == null) {
m.throwNpe();
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
eVar = bufferedSink.g();
2021-06-27 20:44:35 +00:00
}
2022-02-14 21:43:51 +00:00
int size = this.f3656b.size();
2021-11-08 18:25:28 +00:00
for (int i = 0; i < size; i++) {
if (i > 0) {
eVar.T(38);
2021-06-27 20:44:35 +00:00
}
2022-02-14 21:43:51 +00:00
eVar.b0(this.f3656b.get(i));
2021-11-08 18:25:28 +00:00
eVar.T(61);
2021-12-21 23:37:30 +00:00
eVar.b0(this.c.get(i));
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
if (!z2) {
return 0;
2021-06-27 20:44:35 +00:00
}
2021-12-17 22:03:14 +00:00
long j = eVar.k;
2021-11-08 18:25:28 +00:00
eVar.skip(j);
return j;
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
@Override // okhttp3.RequestBody
public long contentLength() {
return a(null, true);
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
@Override // okhttp3.RequestBody
public MediaType contentType() {
return a;
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
@Override // okhttp3.RequestBody
public void writeTo(BufferedSink bufferedSink) throws IOException {
m.checkParameterIsNotNull(bufferedSink, "sink");
a(bufferedSink, false);
2021-06-27 20:44:35 +00:00
}
}