Here you can find the source of getResourceStream(final String resource)
public static InputStream getResourceStream(final String resource)
//package com.java2s; //License from project: Apache License import java.io.InputStream; public class Main { public static InputStream getResourceStream(final String resource) { return getClassLoader().getResourceAsStream(resource); }/*from ww w. ja va 2s. co m*/ private static ClassLoader getClassLoader() { return Thread.currentThread().getContextClassLoader(); } }