60 lines
2.1 KiB
Java
60 lines
2.1 KiB
Java
package com.google.android.gms.internal.firebase_ml;
|
|
|
|
import com.huawei.hms.framework.common.ContainerUtils;
|
|
import java.io.BufferedWriter;
|
|
import java.io.IOException;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStreamWriter;
|
|
import java.io.Writer;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zzft extends zzev {
|
|
private Object data;
|
|
|
|
public zzft(Object obj) {
|
|
super(zzfu.MEDIA_TYPE);
|
|
this.data = zzks.checkNotNull(obj);
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzhy
|
|
public final void writeTo(OutputStream outputStream) throws IOException {
|
|
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, zzeu()));
|
|
boolean z = true;
|
|
for (Map.Entry<String, Object> entry : zzhf.zzf(this.data).entrySet()) {
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
String zzaq = zzie.zzaq(entry.getKey());
|
|
Class<?> cls = value.getClass();
|
|
if ((value instanceof Iterable) || cls.isArray()) {
|
|
Iterator it = zzia.zzi(value).iterator();
|
|
while (it.hasNext()) {
|
|
z = zza(z, bufferedWriter, zzaq, it.next());
|
|
}
|
|
} else {
|
|
z = zza(z, bufferedWriter, zzaq, value);
|
|
}
|
|
}
|
|
}
|
|
bufferedWriter.flush();
|
|
}
|
|
|
|
private static boolean zza(boolean z, Writer writer, String str, Object obj) throws IOException {
|
|
if (obj != null && !zzhf.isNull(obj)) {
|
|
if (z) {
|
|
z = false;
|
|
} else {
|
|
writer.write(ContainerUtils.FIELD_DELIMITER);
|
|
}
|
|
writer.write(str);
|
|
String zzaq = zzie.zzaq(obj instanceof Enum ? zzhl.zza((Enum<?>) obj).getName() : obj.toString());
|
|
if (zzaq.length() != 0) {
|
|
writer.write(ContainerUtils.KEY_VALUE_DELIMITER);
|
|
writer.write(zzaq);
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
}
|