private static int intToSignedBits(int i, int size) {
		if (i < 0) {
			i = (1 << size - 1) + (i & ((1 << size - 1) - 1));
		}
		return i;
	}
Convert an integer into the signed bits of a given length.
ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java