public static InputStream getResourceAsStream(String resource,
                                                  boolean classesFirst, Class<?>... classes) {
        URL url = getResource(resource, classesFirst, classes);
        try {
            return url != null ? url.openStream() : null;
        } catch (IOException e) {
            return null;
        }
    }
If classesFirst is false, retrieves the resource as an input stream via the context class
loader of the current thread, and if not found, via the class loaders of the optionally
specified classes in the order of their specification, and if not found, from the class
loader of {@link ClassLoaderHelper} as the last resort.
<p>
If classesFirst is true, retrieves the resource as an input stream via the optionally
specified classes in the order of their specification, and if not found, via the context
class loader of the current thread, and if not found, from the class loader of
{@link ClassLoaderHelper} as the last resort.

@param resource
           resource to be loaded
@param classesFirst
           true if the class loaders of the optionally specified classes take precedence over
           the context class loader of the current thread; false if the opposite is true.
@param classes
           class loader providers
@return the resource loaded as an input stream or null if not found.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/ClassLoaderHelper.java