public static byte[] toBytes(final double d) {
    // Encode it as a long
    return Bytes.toBytes(Double.doubleToRawLongBits(d));
  }
Serialize a double as the IEEE 754 double format output. The resultant array will be 8 bytes
long.
@param d value
@return the double represented as byte []
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java