Here you can find the source of getStream(String resource)
Parameter | Description |
---|---|
resource | The resource's identifier. |
public static InputStream getStream(String resource)
//package com.java2s; //License from project: Open Source License import java.io.BufferedInputStream; import java.io.InputStream; public class Main { /**//from ww w .j a va2 s . c o m * Retrieves a resource using the current context classloader. * @param resource The resource's identifier. * @return An input stream for the resource. */ public static InputStream getStream(String resource) { return new BufferedInputStream( Thread.currentThread().getContextClassLoader().getResourceAsStream(resource)); } }