getResourceStream

open fun getResourceStream(pathname: String): InputStream

Method to get the stream of a resource file

Return

the stream of a resource file as InputStream

Parameters

pathname

: the pathname of the resource to get its stream

Throws

when an error occurred during the fetching of the resource


open fun <T> getResourceStream(pathname: String, context: Class<T>): InputStream

Method to get the stream of a resource file

Return

the stream of a resource file as InputStream

Parameters

pathname

: the pathname of the resource to get its stream

context

: the context class from get its classloader to reach the resources folder

<T>

the class type of the context e.g. MyCallingClass.class

Throws

when an error occurred during the fetching of the resource