writeImageBlock(image);
if (multi) { int repeatCount = loader.repeatCount; try { outputStream.write(GIF_EXTENSION_BLOCK_ID); outputStream.write(GIF_APPLICATION_EXTENSION_BLOCK_ID); outputStream.write((byte)11); outputStream.write("NETSCAPE2.0".getBytes()); outputStream.write((byte)3); outputStream.writeByte((byte)1); outputStream.write((byte) repeatCount & 0xFF); outputStream.write((byte) (repeatCount >> 8) & 0xFF); outputStream.writeByte((byte)0); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } }  for (int frame=0; frame<frameCount; frame++) {   if (multi || data[frame].transparentPixel != -1) { writeGraphicsControlBlock(data[frame]); }   int x = data[frame].x; int y = data[frame].y; int width = data[frame].width; int height = data[frame].height; try { outputStream.write(GIF_IMAGE_BLOCK_ID); byte[] block = new byte[9]; block[0] = (byte)(x & 0xFF); block[1] = (byte)((x >> 8) & 0xFF); block[2] = (byte)(y & 0xFF); block[3] = (byte)((y >> 8) & 0xFF); block[4] = (byte)(width & 0xFF); block[5] = (byte)((width >> 8) & 0xFF); block[6] = (byte)(height & 0xFF); block[7] = (byte)((height >> 8) & 0xFF); block[8] = (byte)(globalTable == 0 ? (depth-1) | 0x80 : 0x00); outputStream.write(block); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); }   if (globalTable == 0) { writePalette(data[frame].palette, depth); }   try { outputStream.write(depth); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } new LZWCodec().encode(outputStream, data[frame]); }
	void unloadIntoByteStream(ImageData image) {		if (!((image.depth == 1) || (image.depth == 4) || (image.depth == 8))) {			SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);		}		byte bitField = (byte)((0x80 & 0xF8 & 0xF7 & 0x8F) + (image.depth - 1) + ((image.depth - 1) * 16));		try {			outputStream.write(new byte[] { (byte)'G', (byte)'I', (byte)'F' });			outputStream.write(new byte[] { (byte)'8', (byte)'9', (byte)'a' });			outputStream.writeShort((short)image.width);			outputStream.writeShort((short)image.height);			outputStream.writeByte(bitField);			outputStream.writeByte((byte)0);			outputStream.writeByte((byte)0);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}		writePalette(image.palette, image.depth);		if (image.transparentPixel != -1 || image.disposalMethod != 0 || image.delayTime != 0) {			writeGraphicsControlBlock(image);		}		writeImageBlock(image);		try {			outputStream.write(0x3B);		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}	}