I am able to read png file. But getting ArrayIndexOutOfBoundsException: 4096 while reading gif file.
byte[] fileData = imageFile.getFileData();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(fileData);
RenderedImage image = ImageIO.read(byteArrayInputStream)
Exception thrown looks like
java.lang.ArrayIndexOutOfBoundsException: 4096
at com.sun.imageio.plugins.gif.GIFImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
原文地址:http://stackoverflow.com/questions/22259714/arrayindexoutofboundsexception-4096-while-reading-gif-file