Here you can find the source of getReader(String fileDir, String fileName, String encoding)
public static BufferedReader getReader(String fileDir, String fileName, String encoding)
//package com.java2s; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static BufferedReader getReader(String fileDir, String fileName, String encoding) { try {/*from w ww .j av a2 s. com*/ File file = new File(fileDir, fileName); InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding); BufferedReader br = new BufferedReader(read); return br; } catch (FileNotFoundException ex) { ex.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; } } }