Here you can find the source of byteArrayToDouble(byte[] b)
public static double byteArrayToDouble(byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { public static double byteArrayToDouble(byte[] b) { long l = byteArrayToLong(b); return Double.longBitsToDouble(l); }/* w w w .jav a 2s .c o m*/ public static long byteArrayToLong(byte[] b) { //8 16 24 32 40 48 56 .. return ((long) byteAt(b, 0) << 56) + ((long) (byteAt(b, 1) & 0xFF) << 48) + ((long) (byteAt(b, 2) & 0xFF) << 40) + ((long) (byteAt(b, 3) & 0xFF) << 32) + ((long) (byteAt(b, 4) & 0xFF) << 24) + ((long) (byteAt(b, 5) & 0xFF) << 16) + ((long) (byteAt(b, 6) & 0xFF) << 8) + ((long) byteAt(b, 7) & 0xFF); } private static byte byteAt(byte[] b, int p) { if (b != null && p < b.length) return b[p]; return 0; } }