工作空间 v3.7.4.6版本的 MD5 值为:94c1c0052e9f2e949ae1349e6caf437b

以下内容为反编译后的 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;
class h implements g.a<InputStream> {
    final g.c f2351a;

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

    @Override
    public Class<InputStream> getDataClass() {
        return InputStream.class;
    }

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

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