Here you can find the source of toDouble(byte[] bytes)
public static double toDouble(byte[] bytes)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Shuichi Miura.//www. j a v a 2s .com * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * Shuichi Miura - initial API and implementation ******************************************************************************/ public class Main { public static double toDouble(byte[] bytes) { long longValue = toLong(bytes); return Double.longBitsToDouble(longValue); } public static long toLong(byte[] bytes) { return ((long) bytes[7] & 255L) + (((long) bytes[6] & 255L) << 8) + (((long) bytes[5] & 255L) << 16) + (((long) bytes[4] & 255L) << 24) + (((long) bytes[3] & 255L) << 32) + (((long) bytes[2] & 255L) << 40) + (((long) bytes[1] & 255L) << 48) + (((long) bytes[0] & 255L) << 56); } }