111 lines
4.0 KiB
Java
111 lines
4.0 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import com.google.android.gms.internal.firebase_ml.zzsn;
|
||
|
import com.google.android.gms.internal.firebase_ml.zzso;
|
||
|
import java.io.IOException;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Collection;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public abstract class zzsn<MessageType extends zzsn<MessageType, BuilderType>, BuilderType extends zzso<MessageType, BuilderType>> implements zzvo {
|
||
|
private static boolean zzbkb = false;
|
||
|
protected int zzbka = 0;
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzvo
|
||
|
public final zzsw zzpp() {
|
||
|
try {
|
||
|
zzte zzcn = zzsw.zzcn(zzqy());
|
||
|
zzb(zzcn.zzqc());
|
||
|
return zzcn.zzqb();
|
||
|
} catch (IOException e) {
|
||
|
String name = getClass().getName();
|
||
|
StringBuilder sb = new StringBuilder(String.valueOf(name).length() + 72);
|
||
|
sb.append("Serializing ");
|
||
|
sb.append(name);
|
||
|
sb.append(" to a ByteString threw an IOException (should never happen).");
|
||
|
throw new RuntimeException(sb.toString(), e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final byte[] toByteArray() {
|
||
|
try {
|
||
|
byte[] bArr = new byte[zzqy()];
|
||
|
zztl zzg = zztl.zzg(bArr);
|
||
|
zzb(zzg);
|
||
|
zzg.zzqf();
|
||
|
return bArr;
|
||
|
} catch (IOException e) {
|
||
|
String name = getClass().getName();
|
||
|
StringBuilder sb = new StringBuilder(String.valueOf(name).length() + 72);
|
||
|
sb.append("Serializing ");
|
||
|
sb.append(name);
|
||
|
sb.append(" to a byte array threw an IOException (should never happen).");
|
||
|
throw new RuntimeException(sb.toString(), e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public int zzpq() {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public void zzch(int i) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static <T> void zza(Iterable<T> iterable, List<? super T> list) {
|
||
|
zzug.checkNotNull(iterable);
|
||
|
if (iterable instanceof zzux) {
|
||
|
List<?> zzrv = ((zzux) iterable).zzrv();
|
||
|
zzux zzuxVar = (zzux) list;
|
||
|
int size = list.size();
|
||
|
for (Object obj : zzrv) {
|
||
|
if (obj == null) {
|
||
|
int size2 = zzuxVar.size();
|
||
|
StringBuilder sb = new StringBuilder(37);
|
||
|
sb.append("Element at index ");
|
||
|
sb.append(size2 - size);
|
||
|
sb.append(" is null.");
|
||
|
String sb2 = sb.toString();
|
||
|
for (int size3 = zzuxVar.size() - 1; size3 >= size; size3--) {
|
||
|
zzuxVar.remove(size3);
|
||
|
}
|
||
|
throw new NullPointerException(sb2);
|
||
|
}
|
||
|
if (obj instanceof zzsw) {
|
||
|
zzuxVar.zzc((zzsw) obj);
|
||
|
} else {
|
||
|
zzuxVar.add((String) obj);
|
||
|
}
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (iterable instanceof zzwa) {
|
||
|
list.addAll((Collection) iterable);
|
||
|
return;
|
||
|
}
|
||
|
if ((list instanceof ArrayList) && (iterable instanceof Collection)) {
|
||
|
((ArrayList) list).ensureCapacity(list.size() + ((Collection) iterable).size());
|
||
|
}
|
||
|
int size4 = list.size();
|
||
|
for (T t : iterable) {
|
||
|
if (t == null) {
|
||
|
int size5 = list.size();
|
||
|
StringBuilder sb3 = new StringBuilder(37);
|
||
|
sb3.append("Element at index ");
|
||
|
sb3.append(size5 - size4);
|
||
|
sb3.append(" is null.");
|
||
|
String sb4 = sb3.toString();
|
||
|
for (int size6 = list.size() - 1; size6 >= size4; size6--) {
|
||
|
list.remove(size6);
|
||
|
}
|
||
|
throw new NullPointerException(sb4);
|
||
|
}
|
||
|
list.add(t);
|
||
|
}
|
||
|
}
|
||
|
}
|