what-the-bank/sources/com/airbnb/deeplinkdispatch/base/UtilsKt.java

47 lines
1.5 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.airbnb.deeplinkdispatch.base;
import java.util.ArrayList;
import java.util.List;
import o.C14957gcv;
import o.gdP;
/* loaded from: classes.dex */
public final class UtilsKt {
public static final List<CharSequence> chunkOnModifiedUtf8ByteSize(CharSequence charSequence, int i) {
C14957gcv.e(charSequence, "");
if (i < 3) {
throw new IllegalArgumentException("UTF-8 chars can be up to 3 bytes wide. Minumum chunk size is 3 bytes.".toString());
}
ArrayList arrayList = new ArrayList();
int length = charSequence.length();
int i2 = 0;
int i3 = 0;
while (i2 < length) {
int i4 = i2 + 1;
String obj = charSequence.subSequence(i3, i4).toString();
byte[] bytes = obj.getBytes(gdP.a);
C14957gcv.c(bytes, "");
int length2 = bytes.length;
String str = obj;
int i5 = 0;
int i6 = 0;
while (i5 < str.length()) {
char charAt = str.charAt(i5);
i5++;
if (charAt == 0) {
i6++;
}
}
if (length2 + i6 > i) {
arrayList.add(charSequence.subSequence(i3, i2));
i3 = i2;
}
i2 = i4;
}
if (i3 != charSequence.length()) {
arrayList.add(charSequence.subSequence(i3, charSequence.length()));
}
return arrayList;
}
}