Here you can find the source of newReader(File file, Charset charset)
static BufferedReader newReader(File file, Charset charset) throws FileNotFoundException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.nio.charset.Charset; import javax.annotation.Nullable; public class Main { static BufferedReader newReader(File file, Charset charset) throws FileNotFoundException { checkNotNull(file);//from w w w. j av a2 s. c om checkNotNull(charset); return new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); } static <T> T checkNotNull(T reference, @Nullable Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; } static <T> T checkNotNull(T reference) { if (reference == null) { throw new NullPointerException(); } return reference; } }