Here you can find the source of openReader(String dir, String filename, String encoding)
public static BufferedReader openReader(String dir, String filename, String encoding) throws IOException
//package com.java2s; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static BufferedReader openReader(String dir, String filename, String encoding) throws IOException { File file = new File(dir + filename); return new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding), 4 * 1024); }//from www . ja va 2s . co m }