Here you can find the source of getResourceStream(String name)
public static InputStream getResourceStream(String name)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; public class Main { /** Resources are those stored in the class path (e.g., src/main/resources). */ public static InputStream getResourceStream(String name) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return loader.getResourceAsStream(name); }/*from w ww . j av a 2s. c o m*/ }