public int readSimpleGamma() throws InvalidGammaValue, EOFException {
		int gamma = readUint8();

		if (bitmask(gamma, 0x80)) {
			gamma &= ~0x80;
			if (bitmask(gamma, 0x40)) {
				gamma &= ~0x40;
				if (bitmask(gamma, 0x20)) {
					gamma &= ~0x20;
					if (bitmask(gamma, 0x10)) {
						throw new InvalidGammaValue();
					}
					gamma = ((gamma << 8) | readUint8());
				}
				gamma = ((gamma << 8) | readUint8());
			}
			gamma = ((gamma << 8) | readUint8());
		}
		return gamma;
	}