what-the-bank/sources/okhttp3/repackaged/internal/http/HeaderParser.java

38 lines
973 B
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package okhttp3.repackaged.internal.http;
/* loaded from: classes6.dex */
public final class HeaderParser {
public static int skipUntil(String str, int i, String str2) {
while (i < str.length() && str2.indexOf(str.charAt(i)) == -1) {
i++;
}
return i;
}
public static int skipWhitespace(String str, int i) {
char charAt;
while (i < str.length() && ((charAt = str.charAt(i)) == ' ' || charAt == '\t')) {
i++;
}
return i;
}
public static int parseSeconds(String str, int i) {
try {
long parseLong = Long.parseLong(str);
if (parseLong > 2147483647L) {
return Integer.MAX_VALUE;
}
if (parseLong < 0) {
return 0;
}
return (int) parseLong;
} catch (NumberFormatException unused) {
return i;
}
}
private HeaderParser() {
}
}