// The integer portion is in 2's Compliment
byte[] tempByte = {sensorData[6]};
BigInteger bigTemp = new BigInteger(tempByte);
// The decimal portion is NOT in 2's Compliment
int tempDecimal = 0x000000ff & (int) sensorData[7];
TEMPERATURE_CELSIUS = (float) (bigTemp.floatValue() + (tempDecimal >> 4) / 16.0);
TEMPERATURE_KELVIN = (float) (TEMPERATURE_CELSIUS - 273.15);
TEMPERATURE_FAHRENHEIT = (float) (TEMPERATURE_CELSIUS * (9.0 / 5.0) + 32.0);
}
}
};