package com.ifpdos.autotest.lancontrol.module.other.e.y;

import android.content.Context;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/* JADX INFO: compiled from: LutRGB.java */
/* JADX INFO: loaded from: classes.dex */
public class e {
    public static g[] a(Context context) throws IOException {
        ArrayList arrayList = new ArrayList();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(context.getAssets().open("lut.csv")));
        while (true) {
            try {
                String line = bufferedReader.readLine();
                if (line == null) {
                    g[] gVarArr = (g[]) arrayList.toArray(new g[arrayList.size()]);
                    bufferedReader.close();
                    return gVarArr;
                }
                String[] strArrSplit = line.split(",");
                if (strArrSplit.length != 3) {
                    throw new IOException("invalid csv file: " + line);
                }
                arrayList.add(new g(strArrSplit[0], strArrSplit[1], strArrSplit[2]));
            } catch (Throwable th) {
                try {
                    bufferedReader.close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
                throw th;
            }
        }
    }
}
