fun finish(): Boolean { if (!started) return false var ok = true started = false try { out.write(0x3b) out.flush() if (closeStream) { out.close() } } catch (e: IOException) { ok = false } transIndex = 0 out = null image = null pixels = null indexedPixels = null colorTab = null closeStream = false firstFrame = true return ok }
Flushes any pending data and closes output file . If writing to an OutputStream , the stream is not closed .