List of utility methods to do Byte Array to Double
double | arr2double(byte[] b) arrdouble int i = 0; int len = 8; int cnt = 0; byte[] tmp = new byte[len]; for (i = 0; i < len; i++) { tmp[cnt] = b[i]; cnt++; long accum = 0; i = 0; for (int shiftBy = 0; shiftBy < 64; shiftBy += 8) { accum |= ((long) (tmp[i] & 0xff)) << shiftBy; i++; return Double.longBitsToDouble(accum); |
double | byteArrayToDouble(byte high[], byte low[]) byte Array To Double double temp = 0; temp += (((long) high[0]) & 0xFF) << 56; temp += (((long) high[1]) & 0xFF) << 48; temp += (((long) high[2]) & 0xFF) << 40; temp += (((long) high[3]) & 0xFF) << 32; temp += (((long) low[0]) & 0xFF) << 24; temp += (((long) low[1]) & 0xFF) << 16; temp += (((long) low[2]) & 0xFF) << 8; ... |
double | byteArrayToDouble(byte[] b) byte Array To Double long l = byteArrayToLong(b); return Double.longBitsToDouble(l); |
double | byteArrayToDouble(byte[] byteArray) byte Array To Double return Double.longBitsToDouble(byteArrayToLong(byteArray));
|
double | byteArrayToDouble(byte[] byteArray) byte array to double double number = 0d; if (byteArray != null && byteArray.length == 8) { long longBits = 0l; longBits = byteArray[0]; longBits &= 0xff; longBits |= ((long) byteArray[1] << 8); longBits &= 0xffff; longBits |= ((long) byteArray[2] << 16); ... |
Double | byteArrayToDouble(byte[] bytes) byte Array To Double long bits = byteArrayToLong(bytes); return Double.longBitsToDouble(bits); |
double[] | byteArrayToDoubleArray(final byte[] raw, final boolean bigEndian, final int length) byte Array To Double Array final double[] d = new double[length]; int i = 0; if (bigEndian) { for (int iii = 0; iii < raw.length; iii += 8) { long ieee754 = 0; ieee754 |= ((raw[iii]) & 0xff); ieee754 <<= 8; ieee754 |= ((raw[iii + 1]) & 0xff); ... |
double | byteArrayToDoubleBE(byte[] data) byte Array To Double BE if (data == null || data.length != 8) return 0x0; return Double.longBitsToDouble(byteArrayToLongBE(data)); |
double | bytes2double(byte[] b) bytesdouble return bytes2double(b, 0); |
double | bytes2double(byte[] bytes) bytesdouble long l = bytes2long(bytes); return Double.longBitsToDouble(l); |