Here you can find the source of getResourceAsStream(Object o, String resource)
public static InputStream getResourceAsStream(Object o, String resource)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; public class Main { public static InputStream getResourceAsStream(Object o, String resource) { String newPath = ""; if (resource.startsWith("/")) { newPath = "/net/ages/alwb/utils/app/resources" + resource; } else {//from ww w . jav a 2s .c om newPath = "/net/ages/alwb/utils/app/resources/" + resource; } try { return o.getClass().getResourceAsStream(newPath); } catch (Exception e) { return null; } } }