title: ArrayIndexOutOfBoundsException: 4096 while reading gif file
body: <p>I am able to read png file. But getting ArrayIndexOutOfBoundsException: 4096 while reading gif file. </p>
  
  <pre><code>byte[] fileData = imageFile.getFileData();
  ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(fileData);
  RenderedImage image = ImageIO.read(byteArrayInputStream)
  </code></pre>
  
  <p>Exception thrown looks like</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>what could be the issue and what is the resolution?</p>