Here you can find the source of double2bytes(double x)
public static byte[] double2bytes(double x)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] double2bytes(double x) { long l = Double.doubleToLongBits(x); return long2bytes(l); }//from w w w . j a v a2 s.com public static byte[] long2bytes(long num) { byte[] buf = new byte[8]; for (int i = buf.length - 1; i >= 0; i--) { buf[i] = (byte) (num & 0x00000000000000ff); num >>= 8; } return buf; } }