class FileHelper {

    public static void handlerWithLine(File file, String encoding, ObjectHandler<String> handler) {
        try (
                BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding))
        ) {
            String line;
            while ((line = reader.readLine()) != null) {
                handler.handler(line);
            }
        } catch (IOException e) {
            logger.error("handler error:" + e.getMessage());
            e.printStackTrace();
        }
    }

}