Here you can find the source of getInputStreamAsResource(Class> clazz, String fileName)
public static InputStream getInputStreamAsResource(Class<?> clazz, String fileName)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; public class Main { public static InputStream getInputStreamAsResource(Class<?> clazz, String fileName) { InputStream stream = clazz.getResourceAsStream(fileName); return stream; }//from w ww .j a va 2s . c om }