Here you can find the source of doubleToByte(double d)
public static byte[] doubleToByte(double d)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] doubleToByte(double d) { byte[] bytes = new byte[8]; long l = Double.doubleToLongBits(d); for (int i = 0; i < bytes.length; i++) { bytes[i] = Long.valueOf(l).byteValue(); l = l >> 8;/* w w w. ja va 2 s. co m*/ } return bytes; } }