The ImageIO is not in the whitelist of GAE. How to read a image(JPG,PNG) from url as ImageBuffer without using ImageIO?
just use this Google App Engine built in API
byte[] b = URLFetchServiceFactory.getURLFetchService().fetch( url ).getContent();
No third party library required !!!
You could read the url stream and create a bytearray using the IOUtils from apache commons.
URL url = new URL(this.url);
InputStream input = url.openStream();
byteArray = IOUtils.toByteArray(input)
Note:
toByteArray method buffers the input internally, so there is no need to use a BufferedInputStream.
EDIT:
BufferedImage is listed as not supported on AppEngine; that means that you CAN'T use that third party library on Google App Engine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With