Java Double to Byte Array DoubleToBytes_With_Little_Endian(double number)

Here you can find the source of DoubleToBytes_With_Little_Endian(double number)

Description

Double To Byte Wit Littl Endian

License

Open Source License

Declaration

public static byte[] DoubleToBytes_With_Little_Endian(double number) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] DoubleToBytes_With_Little_Endian(double number) {
        long tmp = Double.doubleToLongBits(number);
        byte[] bytes = new byte[8];
        for (int i = 0; i < 8; i++) {
            bytes[i] = (byte) (tmp & 0xFF);
            tmp = tmp >> 8;//from   ww  w  .j  a  v  a2  s  .  c  o  m
        }
        return bytes;
    }
}

Related

  1. doubleToBytes(double v, byte[] bytes)
  2. doubleToBytes(double v, byte[] bytes, int off)
  3. doubleToBytes(double value)
  4. doubleToBytes(final double d)
  5. doubleToBytes(final double val)
  6. putDouble(byte[] b, double val)
  7. putDouble(byte[] data, int i, boolean le, double v)
  8. putDouble(double x)