56 lines
1.8 KiB
Java
56 lines
1.8 KiB
Java
|
package o;
|
||
|
|
||
|
import com.bumptech.glide.load.ImageHeaderParser;
|
||
|
import java.io.ByteArrayOutputStream;
|
||
|
import java.io.IOException;
|
||
|
import java.io.InputStream;
|
||
|
import java.nio.ByteBuffer;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class XRI implements iYP<InputStream, RiR> {
|
||
|
private final List<ImageHeaderParser> a;
|
||
|
private final Opg c;
|
||
|
private final iYP<ByteBuffer, RiR> e;
|
||
|
|
||
|
@Override // o.iYP
|
||
|
public final /* synthetic */ Ezi<RiR> a(InputStream inputStream, int i, int i2, unA una) throws IOException {
|
||
|
byte[] a = a(inputStream);
|
||
|
if (a == null) {
|
||
|
return null;
|
||
|
}
|
||
|
return this.e.a(ByteBuffer.wrap(a), i, i2, una);
|
||
|
}
|
||
|
|
||
|
@Override // o.iYP
|
||
|
public final /* synthetic */ boolean a(InputStream inputStream, unA una) throws IOException {
|
||
|
InputStream inputStream2 = inputStream;
|
||
|
wrW<Boolean> wrw = C17312vih.e;
|
||
|
return !((Boolean) (una.d.containsKey(wrw) ? una.d.get(wrw) : wrw.a)).booleanValue() && hKF.a(this.a, inputStream2, this.c) == ImageHeaderParser.ImageType.GIF;
|
||
|
}
|
||
|
|
||
|
public XRI(List<ImageHeaderParser> list, iYP<ByteBuffer, RiR> iyp, Opg opg) {
|
||
|
this.a = list;
|
||
|
this.e = iyp;
|
||
|
this.c = opg;
|
||
|
}
|
||
|
|
||
|
private static byte[] a(InputStream inputStream) {
|
||
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(16384);
|
||
|
try {
|
||
|
byte[] bArr = new byte[16384];
|
||
|
while (true) {
|
||
|
int read = inputStream.read(bArr);
|
||
|
if (read != -1) {
|
||
|
byteArrayOutputStream.write(bArr, 0, read);
|
||
|
} else {
|
||
|
byteArrayOutputStream.flush();
|
||
|
return byteArrayOutputStream.toByteArray();
|
||
|
}
|
||
|
}
|
||
|
} catch (IOException unused) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|