Java Double to Byte Array doubleToByteArray(double value)

Here you can find the source of doubleToByteArray(double value)

Description

double To Byte Array

License

Open Source License

Declaration

static byte[] doubleToByteArray(double value) 

Method Source Code

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

public class Main {
    static byte[] doubleToByteArray(double value) {
        return longToByteArray(Double.doubleToRawLongBits(value));
    }// ww  w.j  a  va2 s .c  o  m

    static byte[] longToByteArray(long value) {
        return new byte[] { (byte) value, (byte) (value >> 8), (byte) (value >> 16), (byte) (value >> 24),
                (byte) (value >> 32), (byte) (value >> 40), (byte) (value >> 48), (byte) (value >> 56) };
    }
}

Related

  1. double2bytes(double x)
  2. double2bytesLE(double val, byte[] b, int off)
  3. doubleToByteArray(double d)
  4. doubleToByteArray(double number)
  5. doubleToByteArray(double source)
  6. doubleToByteArrayBE(double data)
  7. doubleToBytes(double d)
  8. doubleToBytes(double d)
  9. doubleToBytes(double d)