package ඓ.ῲ.K.ᕣ.ᕣ.ⁱ;

import android.util.Log;
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;
import ඓ.ῲ.K.ᕣ.AbstractC0853;
import ඓ.ῲ.K.ᕣ.C1121;
import ඓ.ῲ.K.ᕣ.ᨨ.AbstractC1027;
import ඓ.ῲ.K.ᕣ.ᨨ.ゎ.AbstractC0967;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.ῲ.K.ᕣ.ᕣ.ⁱ.㳳  reason: contains not printable characters */
/* compiled from: StreamGifDecoder */
public class C0914 implements AbstractC0853<InputStream, C0901> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC0967 f4201;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final AbstractC0853<ByteBuffer, C0901> f4202;

    /* renamed from: K  reason: contains not printable characters */
    public final List<ImageHeaderParser> f4203;

    public C0914(List<ImageHeaderParser> list, AbstractC0853<ByteBuffer, C0901> r2, AbstractC0967 r3) {
        this.f4203 = list;
        this.f4202 = r2;
        this.f4201 = r3;
    }

    /* Return type fixed from 'ඓ.ῲ.K.ᕣ.ᨨ.䀟' to match base method */
    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, int, int, ඓ.ῲ.K.ᕣ.㸾] */
    @Override // ඓ.ῲ.K.ᕣ.AbstractC0853
    /* renamed from: K  reason: contains not printable characters */
    public AbstractC1027<C0901> m2617(InputStream inputStream, int i, int i2, C1121 r9) throws IOException {
        byte[] bArr;
        InputStream inputStream2 = inputStream;
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(16384);
        try {
            byte[] bArr2 = new byte[16384];
            while (true) {
                int read = inputStream2.read(bArr2);
                if (read == -1) {
                    break;
                }
                byteArrayOutputStream.write(bArr2, 0, read);
            }
            byteArrayOutputStream.flush();
            bArr = byteArrayOutputStream.toByteArray();
        } catch (IOException e) {
            if (Log.isLoggable("StreamGifDecoder", 5)) {
                Log.w("StreamGifDecoder", "Error reading data from stream", e);
            }
            bArr = null;
        }
        if (bArr == null) {
            return null;
        }
        return this.f4202.m2472(ByteBuffer.wrap(bArr), i, i2, r9);
    }

    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, ඓ.ῲ.K.ᕣ.㸾] */
    @Override // ඓ.ῲ.K.ᕣ.AbstractC0853
    /* renamed from: K  reason: contains not printable characters */
    public boolean m2618(InputStream inputStream, C1121 r3) throws IOException {
        return !((Boolean) r3.m3002(C0904.f4167)).booleanValue() && C1841.m4755(this.f4203, inputStream, this.f4201) == ImageHeaderParser.ImageType.GIF;
    }
}
