public void nextFrame(SortData data) throws IOException { unpackData(data); if (width == 0 || height == 0) { this.findDimensions(); } BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); build(image, g); g.dispose(); // free up resources used by graphics context o.addFrame(image); }
public void endGif() throws IOException { o.close(); }