what-the-bank/sources/com/google/android/gms/maps/model/MapStyleOptions.java

43 lines
1.7 KiB
Java

package com.google.android.gms.maps.model;
import android.content.Context;
import android.content.res.Resources;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.google.android.gms.common.util.IOUtils;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class MapStyleOptions extends AbstractSafeParcelable {
public static final Parcelable.Creator<MapStyleOptions> CREATOR = new zzg();
private static final String TAG = "MapStyleOptions";
private String zzdl;
public MapStyleOptions(String str) {
this.zzdl = str;
}
public static MapStyleOptions loadRawResourceStyle(Context context, int i) throws Resources.NotFoundException {
try {
return new MapStyleOptions(new String(IOUtils.readInputStreamFully(context.getResources().openRawResource(i)), "UTF-8"));
} catch (IOException e) {
String valueOf = String.valueOf(e);
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 37);
sb.append("Failed to read resource ");
sb.append(i);
sb.append(": ");
sb.append(valueOf);
throw new Resources.NotFoundException(sb.toString());
}
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeString(parcel, 2, this.zzdl, false);
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
}
}