Here you can find the source of getReader(String path, String charEncoding)
public static BufferedReader getReader(String path, String charEncoding) throws UnsupportedEncodingException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; public class Main { public static BufferedReader getReader(String path, String charEncoding) throws UnsupportedEncodingException { InputStream is = getInputStream(path); return new BufferedReader(new InputStreamReader(is, charEncoding)); }/*from w w w . j a v a2 s .co m*/ public static BufferedReader getReader(InputStream inputStream, String charEncoding) throws UnsupportedEncodingException { return new BufferedReader(new InputStreamReader(inputStream, charEncoding)); } public static InputStream getInputStream(String path) { try { return new FileInputStream(path); } catch (FileNotFoundException e) { e.printStackTrace(); } return null; } }