width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24); height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24); bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
int width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24); int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24); int bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
ImageData[] loadFromByteStream() {	int[] fileHeader = loadFileHeader();	byte[] infoHeader = new byte[BMPHeaderFixedSize];	try {		inputStream.read(infoHeader);	} catch (Exception e) {		SWT.error(SWT.ERROR_IO, e);	}	width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);	height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);	bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);	PaletteData palette = loadPalette(infoHeader);	if (inputStream.getPosition() < fileHeader[4]) {		// Seek to the specified offset		try {			inputStream.skip(fileHeader[4] - inputStream.getPosition());		} catch (IOException e) {			SWT.error(SWT.ERROR_IO, e);		}	}	byte[] data = loadData(infoHeader);	this.compression = (infoHeader[16] & 0xFF) | ((infoHeader[17] & 0xFF) << 8) | ((infoHeader[18] & 0xFF) << 16) | ((infoHeader[19] & 0xFF) << 24);	this.importantColors = (infoHeader[36] & 0xFF) | ((infoHeader[37] & 0xFF) << 8) | ((infoHeader[38] & 0xFF) << 16) | ((infoHeader[39] & 0xFF) << 24);	int xPelsPerMeter = (infoHeader[24] & 0xFF) | ((infoHeader[25] & 0xFF) << 8) | ((infoHeader[26] & 0xFF) << 16) | ((infoHeader[27] & 0xFF) << 24);	int yPelsPerMeter = (infoHeader[28] & 0xFF) | ((infoHeader[29] & 0xFF) << 8) | ((infoHeader[30] & 0xFF) << 16) | ((infoHeader[31] & 0xFF) << 24);	this.pelsPerMeter = new Point(xPelsPerMeter, yPelsPerMeter);	int type = (this.compression == 1 /*BMP_RLE8_COMPRESSION*/) || (this.compression == 2 /*BMP_RLE4_COMPRESSION*/) ? SWT.IMAGE_BMP_RLE : SWT.IMAGE_BMP;	return new ImageData[] {		ImageData.internal_new(			width,			height,			bitCount,			palette,			4,			data,			0,			null,			null,			-1,			-1,			type,			0,			0,			0,			0)	};}