Java Utililty Methods Double to Byte

List of utility methods to do Double to Byte

Description

The list of methods to do Double to Byte are organized into topic(s).

Method

byte[]double2byte(double d)
doublebyte
byte dest[] = new byte[8];
return setdouble(dest, 0, d);
bytedouble2byte(double d)
Converts a Double value to a Byte value.
return (byte) (((long) d << 56) >> 56);
byteDouble2Byte(double i)
Double Byte
byte o;
try {
    o = new Double(i).byteValue();
} catch (Exception e) {
    o = 0;
return o;
BytedoubleToByte(double d)
double To Byte
if (d >= Byte.MIN_VALUE && d <= Byte.MAX_VALUE) {
    return (byte) d;
return null;
byte[]doubleToByte(double d)
double To Byte
long x = Double.doubleToLongBits(d);
if ((x & 0xFFFFFFFFFFFFFF00L) == 0L) {
    return new byte[] { (byte) x };
} else if ((x & 0xFFFFFFFFFFFF0000L) == 0L) {
    return new byte[] { (byte) (x >> 8), (byte) x };
} else if ((x & 0xFFFFFFFFFF000000L) == 0L) {
    return new byte[] { (byte) (x >> 16), (byte) (x >> 8), (byte) x };
} else if ((x & 0xFFFFFFFF00000000L) == 0L) {
...
byte[]doubleToByte(double d)
double To Byte
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;
return bytes;
byte[]doubleToByte(double i_Value)
double To Byte
return longToByte(Double.doubleToLongBits(i_Value));
byte[]doubleToByte(double[] values)
double To Byte
if (values == null) {
    return null;
byte[] results = new byte[values.length];
for (int i = 0; i < values.length; i++) {
    results[i] = (byte) values[i];
return results;
...
BytedoubleToByte(final double value)
double To Byte
return (byte) value;