Here you can find the source of reader(Class> baseClass, String resourceName, Charset charset)
static public Reader reader(Class<?> baseClass, String resourceName, Charset charset) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; import java.net.URL; import java.nio.charset.Charset; public class Main { static public Reader reader(Class<?> baseClass, String resourceName, Charset charset) throws IOException { return new InputStreamReader(inputStream(baseClass, resourceName), charset);//w w w.jav a 2 s . c o m } static public InputStream inputStream(Class<?> baseClass, String resourceName) throws IOException { URL url = baseClass.getResource(resourceName); if (url == null) { throw new FileNotFoundException(String.format( "Resource file is not found. %s", resourceName)); } return url.openStream(); } }