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);
int bits = globalTable*128 + (depth-1)*16 + depth-1; outputStream.write("GIF89a".getBytes()); outputStream.writeShort((short)logicalScreenWidth); outputStream.writeShort((short)logicalScreenHeight); outputStream.writeByte((byte)bits); outputStream.writeByte((byte)backgroundPixel);
	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);		}	}