Here you can find the source of getResourceAsStream(String name)
Parameter | Description |
---|---|
name | Resource Name |
public static InputStream getResourceAsStream(String name)
//package com.java2s; //License from project: Apache License import java.io.InputStream; public class Main { /**//from w w w . j a v a2 s.c o m * @param name Resource Name * @return Resource Input Stream */ public static InputStream getResourceAsStream(String name) { ClassLoader cl = getClassLoader(); if (cl == null) { return null; } return cl.getResourceAsStream(name); } private static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { return ClassLoader.getSystemClassLoader(); } return cl; } }