public static String toBase64(FacesContext context, InputStream is) {
        return toBase64(context, toByteArray(is), null);
    }
Used to extract resource name (e.g. "#{resource['picture.png'}")
primefaces/src/main/java/org/primefaces/util/ResourceUtils.java