Here you can find the source of toDouble(byte[] data)
public static double toDouble(byte[] data)
//package com.java2s; //License from project: Apache License public class Main { public static double toDouble(byte[] data) { if (data.length != 8) return 0; return Double.longBitsToDouble(toLong(data)); }//from w w w . j a v a 2 s .c o m public static long toLong(byte[] data) { if (data.length != 8) return 0; return (long) data[0] << 56 | (long) data[1] << 48 | (long) data[2] << 40 | (long) data[3] << 32 | (int) data[4] << 24 | (int) data[5] << 16 | (int) data[6] << 8 | (int) data[7]; } }