private ImageWriter getWriter() throws IIOException {
        Iterator<ImageWriter> iter = ImageIO.getImageWritersBySuffix("gif");
        if (!iter.hasNext()) {
            throw new IIOException("No GIF Image Writers Exist");
        } else {
            ImageWriter next = iter.next();
            return next;
        }
    }
Returns the first available GIF ImageWriter using
ImageIO.getImageWritersBySuffix("gif").

@return a GIF ImageWriter object
@throws IIOException if no GIF image writers are returned
src/main/java/com/kodedu/animation/GifSequenceWriter.java