package com.bumptech.glide.c.c;

import com.bumptech.glide.c.b.a.b;
import com.bumptech.glide.c.d;
import com.bumptech.glide.c.j;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.io.File;
import java.io.InputStream;

public final class t implements d<InputStream> {
    private final b azx;

    public final /* bridge */ /* synthetic */ boolean a(Object obj, File file, j jVar) {
        AppMethodBeat.i(92133);
        boolean a = a((InputStream) obj, file);
        AppMethodBeat.o(92133);
        return a;
    }

    public t(b bVar) {
        this.azx = bVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:26:0x004e A:{SYNTHETIC, Splitter:B:26:0x004e} */
    /* JADX WARNING: Removed duplicated region for block: B:12:0x002f A:{SYNTHETIC, Splitter:B:12:0x002f} */
    private boolean a(java.io.InputStream r7, java.io.File r8) {
        /*
        r6 = this;
        r1 = 0;
        r5 = 92132; // 0x167e4 float:1.29104E-40 double:4.55193E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r5);
        r0 = r6.azx;
        r2 = 65536; // 0x10000 float:9.18355E-41 double:3.2379E-319;
        r3 = byte[].class;
        r0 = r0.a(r2, r3);
        r0 = (byte[]) r0;
        r3 = 0;
        r2 = new java.io.FileOutputStream;	 Catch:{ IOException -> 0x0062, all -> 0x004a }
        r2.<init>(r8);	 Catch:{ IOException -> 0x0062, all -> 0x004a }
    L_0x0019:
        r3 = r7.read(r0);	 Catch:{ IOException -> 0x0025 }
        r4 = -1;
        if (r3 == r4) goto L_0x003c;
    L_0x0020:
        r4 = 0;
        r2.write(r0, r4, r3);	 Catch:{ IOException -> 0x0025 }
        goto L_0x0019;
    L_0x0025:
        r3 = move-exception;
    L_0x0026:
        r3 = "StreamEncoder";
        r4 = 3;
        android.util.Log.isLoggable(r3, r4);	 Catch:{ all -> 0x0060 }
        if (r2 == 0) goto L_0x0032;
    L_0x002f:
        r2.close();	 Catch:{ IOException -> 0x005c }
    L_0x0032:
        r2 = r6.azx;
        r2.put(r0);
        r0 = r1;
    L_0x0038:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        return r0;
    L_0x003c:
        r2.close();	 Catch:{ IOException -> 0x0025 }
        r1 = 1;
        r2.close();	 Catch:{ IOException -> 0x005a }
    L_0x0043:
        r2 = r6.azx;
        r2.put(r0);
        r0 = r1;
        goto L_0x0038;
    L_0x004a:
        r1 = move-exception;
        r2 = r3;
    L_0x004c:
        if (r2 == 0) goto L_0x0051;
    L_0x004e:
        r2.close();	 Catch:{ IOException -> 0x005e }
    L_0x0051:
        r2 = r6.azx;
        r2.put(r0);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        throw r1;
    L_0x005a:
        r2 = move-exception;
        goto L_0x0043;
    L_0x005c:
        r2 = move-exception;
        goto L_0x0032;
    L_0x005e:
        r2 = move-exception;
        goto L_0x0051;
    L_0x0060:
        r1 = move-exception;
        goto L_0x004c;
    L_0x0062:
        r2 = move-exception;
        r2 = r3;
        goto L_0x0026;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.c.c.t.a(java.io.InputStream, java.io.File):boolean");
    }
}
