Java Double to Byte doubleToByte(double d)

Here you can find the source of doubleToByte(double d)

Description

double To Byte

License

Apache License

Declaration

public static byte[] doubleToByte(double d) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static byte[] doubleToByte(double d) {
        byte[] bytes = new byte[8];
        long l = Double.doubleToLongBits(d);
        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = Long.valueOf(l).byteValue();
            l = l >> 8;/* w  w  w.  ja va 2 s. co  m*/
        }
        return bytes;
    }
}

Related

  1. double2byte(double d)
  2. double2byte(double d)
  3. Double2Byte(double i)
  4. doubleToByte(double d)
  5. doubleToByte(double d)
  6. doubleToByte(double i_Value)
  7. doubleToByte(double[] values)
  8. doubleToByte(final double value)