Here you can find the source of getResource(Class c, String path)
public static InputStream getResource(Class c, String path)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; public class Main { public static InputStream getResource(Class c, String path) { return c.getResourceAsStream(path); }/*from w w w . java2 s. co m*/ }