Here you can find the source of getResourceAsStream(Class> clazz, String resource)
public static InputStream getResourceAsStream(Class<?> clazz, String resource)
//package com.java2s; //License from project: Apache License import java.io.InputStream; public class Main { public static InputStream getResourceAsStream(Class<?> clazz, String resource) {/*from w w w. j av a 2 s . c o m*/ return clazz == null ? ClassLoader .getSystemResourceAsStream(resource) : clazz .getResourceAsStream(resource); } }