As far as I know, all three of these requirements do not exist. Base64 encoding it and loading it directly into an image tag is probably best if you don't want to write it to storage, although you can still write it to internal storage and display it in a webview.
private static final String HTML_FORMAT = "<img src=\"data:image/jpeg;base64,%1$s\" />"; private static void openJpeg(WebView web, byte[] image) { String b64Image = Base64.encode(image, Base64.DEFAULT); String html = String.format(HTML_FORMAT, b64Image); web.loadData(html, "text/html", "utf-8"); }
Jake basile
source share