code: public static byte[] toByteArray(double d, ByteOrder bo) {
      return ByteBuffer.allocate(8).order(bo).putDouble(d).array();
    }
docs: Converts a double into a byte array.
  
  @param d
  a double
  @param bo
  a ByteOrder
  @return byte array