package com.cftech.core.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by 16444 on 2020/11/20.
 */
public class IdcardUtils {

    public static StringBuffer idcards = new StringBuffer();
    public static List<String> idcardList = null;

    static {
        InputStream inputStream = null;
        InputStreamReader inputStreamReader = null;
        try {
            inputStream = IdcardUtils.class.getClassLoader().getResourceAsStream("idcard.txt");
            inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
            int len = 0;
            while ((len = inputStreamReader.read()) != -1) {
                idcards.append(len);
            }
            String str = idcards.toString();
            String[] strArr = str.split(",");
            idcardList = Arrays.asList(strArr);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (inputStreamReader != null) {
                try {
                    inputStreamReader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }

}
