Here you can find the source of getResourceAsReader(String name)
public static InputStreamReader getResourceAsReader(String name)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; import java.io.InputStreamReader; public class Main { public static InputStreamReader getResourceAsReader(String name) { return new InputStreamReader(getResourceAsStream(name)); }/*w w w . j av a 2 s .c om*/ public static InputStream getResourceAsStream(String name) { return Thread.currentThread().getContextClassLoader().getResourceAsStream(name); } }