Here you can find the source of inputStream(Class> baseClass, String resourceName)
static public InputStream inputStream(Class<?> baseClass, String resourceName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; import java.net.URL; public class Main { static public InputStream inputStream(Class<?> baseClass, String resourceName) throws IOException { URL url = baseClass.getResource(resourceName); if (url == null) { throw new FileNotFoundException(String.format( "Resource file is not found. %s", resourceName)); }//w ww . ja v a 2s. c om return url.openStream(); } }