Write animated-gif stored in BufferedImage to java.io.File Object
<p>I am reading a <code>gif</code> image from internet url. </p>

<pre><code>// URL of a sample animated gif, needs to be wrapped in try-catch block
URL imageUrl = new Url("http://4.bp.blogspot.com/-CTUfMbxRZWg/URi_3Sp-vKI/AAAAAAAAAa4/a2n_9dUd2Hg/s1600/Kei_Run.gif");

// reads the image from url and stores in BufferedImage object.
BufferedImage bImage = ImageIO.read(imageUrl);

// creates a new `java.io.File` object with image name
File imageFile = new File("download.gif");

// ImageIO writes BufferedImage into File Object
ImageIO.write(bImage, "gif", imageFile);
</code></pre>

<p>The code executes successfully. But, the saved image is not animated as the source image is.</p>

<p>I have <strong>looked at many of the stack-overflow questions/answers</strong>, but i am not able to get through this. Most of them do it by <code>BufferedImage</code> frame by frame which alters frame-rate. I don't want changes to the source image. I want to download it as it is with same size, same resolution and same frame-rate. </p>

<p>Please keep in mind that <strong>i want to avoid using <code>streams</code> and <code>unofficial-libraries</code> as much as i can</strong>(if it can't be done without them, i will use them).</p>

<p>If there is an alternative to <code>ImageIO</code> or the way i read image from url and it gets the thing done, please point me in that direction.</p>