曹妃甸核酸检测平台.apk(点击下载) / h.java


package com.bumptech.glide.load.b;

import android.util.Base64;
import com.bumptech.glide.load.b.g;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

/* access modifiers changed from: package-private */
public class h implements g.a<InputStream> {

    /* renamed from: a  reason: collision with root package name */
    final /* synthetic */ g.c f1685a;

    h(g.c cVar) {
        this.f1685a = cVar;
    }

    @Override // com.bumptech.glide.load.b.g.a
    public Class<InputStream> a() {
        return InputStream.class;
    }

    public void a(InputStream inputStream) throws IOException {
        inputStream.close();
    }

    @Override // com.bumptech.glide.load.b.g.a
    public InputStream decode(String str) {
        if (str.startsWith("data:image")) {
            int indexOf = str.indexOf(44);
            if (indexOf == -1) {
                throw new IllegalArgumentException("Missing comma in data URL.");
            } else if (str.substring(0, indexOf).endsWith(";base64")) {
                return new ByteArrayInputStream(Base64.decode(str.substring(indexOf + 1), 0));
            } else {
                throw new IllegalArgumentException("Not a base64 image data URL.");
            }
        } else {
            throw new IllegalArgumentException("Not a valid image data URL.");
        }
    }
}