Here you can find the source of convertDoubleFromBytes(final byte[] bytes)
public static double convertDoubleFromBytes(final byte[] bytes)
//package com.java2s; /**/* w ww . j a v a2 s . c om*/ * Copyright (c) 2008-2012 Ardor Labs, Inc. * * This file is part of Ardor3D. * * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ public class Main { public static double convertDoubleFromBytes(final byte[] bytes) { return convertDoubleFromBytes(bytes, 0); } public static double convertDoubleFromBytes(final byte[] bytes, final int offset) { // Convert it to a double final long bits = convertLongFromBytes(bytes, offset); return Double.longBitsToDouble(bits); } public static long convertLongFromBytes(final byte[] bytes) { return convertLongFromBytes(bytes, 0); } public static long convertLongFromBytes(final byte[] bytes, final int offset) { // Convert it to an long return ((((long) bytes[offset + 7]) & 0xFF) + ((((long) bytes[offset + 6]) & 0xFF) << 8) + ((((long) bytes[offset + 5]) & 0xFF) << 16) + ((((long) bytes[offset + 4]) & 0xFF) << 24) + ((((long) bytes[offset + 3]) & 0xFF) << 32) + ((((long) bytes[offset + 2]) & 0xFF) << 40) + ((((long) bytes[offset + 1]) & 0xFF) << 48) + ((((long) bytes[offset + 0]) & 0xFF) << 56)); } }