int idx = i * 2;
int idx = i << 1;
	public synchronized void write(BlockDeviceAPI device, long offset) throws IOException {		byte[] data = new byte[nrSectors * sectorSize];		for (int i = 0; i < entries.length; i++) {			long v = entries[i];			switch (bitSize) {				case 12 :					{						int idx = (int) (i * 1.5);						if ((i % 2) == 0) {							data[idx] = (byte) (v & 0xFF);							data[idx + 1] = (byte) ((v >> 8) & 0x0F);						} else {							data[idx] |= (byte) ((v & 0x0F) << 4);							data[idx + 1] = (byte) ((v >> 4) & 0xFF);						}					}					break;				case 16 :					{						int idx = i * 2;						data[idx] = (byte) (v & 0xFF);						data[idx + 1] = (byte) ((v >> 8) & 0xFF);					}					break;				case 32 :					{						int idx = i * 4;						data[idx] = (byte) (v & 0xFF);						data[idx + 1] = (byte) ((v >> 8) & 0xFF);						data[idx + 2] = (byte) ((v >> 16) & 0xFF);						data[idx + 3] = (byte) ((v >> 24) & 0xFF);					}					break;			}		}		device.write(offset, data, 0, data.length);		this.dirty = false;	}