Here you can find the source of doubleToBytes(double v, byte[] bytes, int off)
public static void doubleToBytes(double v, byte[] bytes, int off)
//package com.java2s; //License from project: Open Source License public class Main { public static void doubleToBytes(double v, byte[] bytes, int off) { long el = Double.doubleToRawLongBits(v); int shift = 64; int lim = off + 8; for (int i = off; i < lim; i++) { shift -= 8;/* www .j a v a2 s .co m*/ bytes[i] = (byte) ((el >> shift) & 0xFF); } } }