package com.google.android.gms.internal.firebase_ml; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.Collections; import java.util.HashSet; import java.util.Set; /* loaded from: classes2.dex */ public final class zzgg implements zzhu { private final zzge zzwf; private final Set zzwh; /* JADX INFO: Access modifiers changed from: protected */ public zzgg(zzgh zzghVar) { this.zzwf = zzghVar.zzwf; this.zzwh = new HashSet(zzghVar.zzwi); } @Override // com.google.android.gms.internal.firebase_ml.zzhu public final T zza(InputStream inputStream, Charset charset, Class cls) throws IOException { zzgi zza = this.zzwf.zza(inputStream, charset); if (!this.zzwh.isEmpty()) { try { boolean z = (zza.zza(this.zzwh) == null || zza.zzgi() == zzgm.END_OBJECT) ? false : true; Object[] objArr = {this.zzwh}; if (!z) { throw new IllegalArgumentException(zzla.zzb("wrapper key(s) not found: %s", objArr)); } } catch (Throwable th) { zza.close(); throw th; } } return (T) zza.zza(cls, true, null); } public final Set zzge() { return Collections.unmodifiableSet(this.zzwh); } public final zzge zzes() { return this.zzwf; } }