Here you can find the source of getResourceAsBufferedReader(Class> clazz, String resourceName)
public static BufferedReader getResourceAsBufferedReader(Class<?> clazz, String resourceName)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; public class Main { public static BufferedReader getResourceAsBufferedReader(Class<?> clazz, String resourceName) { return new BufferedReader(getResourceAsInputStreamReader(clazz, resourceName)); }//from w w w . j a va2 s.com public static InputStreamReader getResourceAsInputStreamReader(Class<?> clazz, String resourceName) { return new InputStreamReader(getResourceAsStream(clazz, resourceName)); } public static InputStream getResourceAsStream(Class<?> clazz, String resourceName) { return clazz.getResourceAsStream(resourceName); } public static InputStream getResourceAsStream(Class<?> clazz, File file) { return getResourceAsStream(clazz, toResourceName(file)); } public static String toResourceName(File file) { return toResourceName(file.getPath()); } public static String toResourceName(String name) { return name.replaceAll("\\\\", "/"); } }