126 lines
3.9 KiB
Java
126 lines
3.9 KiB
Java
|
package com.google.android.gms.internal.clearcut;
|
||
|
|
||
|
import java.nio.ByteBuffer;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzff {
|
||
|
private static final zzfg zzqb;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public static int zzam(int i) {
|
||
|
if (i > -12) {
|
||
|
return -1;
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public static int zzd(int i, int i2, int i3) {
|
||
|
if (i > -12 || i2 > -65 || i3 > -65) {
|
||
|
return -1;
|
||
|
}
|
||
|
return (i ^ (i2 << 8)) ^ (i3 << 16);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public static int zzp(int i, int i2) {
|
||
|
if (i > -12 || i2 > -65) {
|
||
|
return -1;
|
||
|
}
|
||
|
return i ^ (i2 << 8);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public static int zzf(byte[] bArr, int i, int i2) {
|
||
|
byte b = bArr[i - 1];
|
||
|
int i3 = i2 - i;
|
||
|
if (i3 == 0) {
|
||
|
return zzam(b);
|
||
|
}
|
||
|
if (i3 == 1) {
|
||
|
return zzp(b, bArr[i]);
|
||
|
}
|
||
|
if (i3 == 2) {
|
||
|
return zzd(b, bArr[i], bArr[i + 1]);
|
||
|
}
|
||
|
throw new AssertionError();
|
||
|
}
|
||
|
|
||
|
public static boolean zze(byte[] bArr, int i, int i2) {
|
||
|
return zzqb.zze(bArr, i, i2);
|
||
|
}
|
||
|
|
||
|
public static boolean zze(byte[] bArr) {
|
||
|
return zzqb.zze(bArr, 0, bArr.length);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static void zza(CharSequence charSequence, ByteBuffer byteBuffer) {
|
||
|
zzfg zzfgVar = zzqb;
|
||
|
if (byteBuffer.hasArray()) {
|
||
|
int arrayOffset = byteBuffer.arrayOffset();
|
||
|
byteBuffer.position(zza(charSequence, byteBuffer.array(), byteBuffer.position() + arrayOffset, byteBuffer.remaining()) - arrayOffset);
|
||
|
} else if (byteBuffer.isDirect()) {
|
||
|
zzfgVar.zzb(charSequence, byteBuffer);
|
||
|
} else {
|
||
|
zzfg.zzc(charSequence, byteBuffer);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static int zza(CharSequence charSequence, byte[] bArr, int i, int i2) {
|
||
|
return zzqb.zzb(charSequence, bArr, i, i2);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static int zza(CharSequence charSequence) {
|
||
|
int length = charSequence.length();
|
||
|
int i = 0;
|
||
|
int i2 = 0;
|
||
|
while (i2 < length && charSequence.charAt(i2) < 128) {
|
||
|
i2++;
|
||
|
}
|
||
|
int i3 = length;
|
||
|
while (true) {
|
||
|
if (i2 >= length) {
|
||
|
break;
|
||
|
}
|
||
|
char charAt = charSequence.charAt(i2);
|
||
|
if (charAt < 2048) {
|
||
|
i3 += (127 - charAt) >>> 31;
|
||
|
i2++;
|
||
|
} else {
|
||
|
int length2 = charSequence.length();
|
||
|
while (i2 < length2) {
|
||
|
char charAt2 = charSequence.charAt(i2);
|
||
|
if (charAt2 < 2048) {
|
||
|
i += (127 - charAt2) >>> 31;
|
||
|
} else {
|
||
|
i += 2;
|
||
|
if (55296 <= charAt2 && charAt2 <= 57343) {
|
||
|
if (Character.codePointAt(charSequence, i2) < 65536) {
|
||
|
throw new zzfi(i2, length2);
|
||
|
}
|
||
|
i2++;
|
||
|
}
|
||
|
}
|
||
|
i2++;
|
||
|
}
|
||
|
i3 += i;
|
||
|
}
|
||
|
}
|
||
|
if (i3 >= length) {
|
||
|
return i3;
|
||
|
}
|
||
|
StringBuilder sb = new StringBuilder(54);
|
||
|
sb.append("UTF-8 length does not fit in int: ");
|
||
|
sb.append(i3 + 4294967296L);
|
||
|
throw new IllegalArgumentException(sb.toString());
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
zzqb = (zzfd.zzed() && zzfd.zzee()) ? new zzfj() : new zzfh();
|
||
|
}
|
||
|
}
|