Here you can find the source of doubleToBytes(double d)
public static byte[] doubleToBytes(double d)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] doubleToBytes(double d) { return longToBytes(Double.doubleToLongBits(d)); }/*from w w w. j a va2s. com*/ public static byte[] longToBytes(long l) { byte[] b = new byte[8]; b[0] = (byte) (l >>> 56); b[1] = (byte) (l >>> 48); b[2] = (byte) (l >>> 40); b[3] = (byte) (l >>> 32); b[4] = (byte) (l >>> 24); b[5] = (byte) (l >>> 16); b[6] = (byte) (l >>> 8); b[7] = (byte) (l); return b; } }