Here you can find the source of createInputStreamReader(File file, String charsetName)
public static InputStreamReader createInputStreamReader(File file, String charsetName) throws FileNotFoundException, UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; public class Main { public static InputStreamReader createInputStreamReader(File file, String charsetName) throws FileNotFoundException, UnsupportedEncodingException { Charset charset = charsetName == null ? Charset.defaultCharset() : Charset.forName(charsetName); return createInputStreamReader(file, charset); }/* w ww .j a v a 2 s . c om*/ public static InputStreamReader createInputStreamReader(File file, Charset charset) throws FileNotFoundException, UnsupportedEncodingException { FileInputStream is = new FileInputStream(file); return new InputStreamReader(is, charset); } }