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() { } }