List of utility methods to do Double to Byte Array
byte[] | doubleToByteArray(double value) double To Byte Array return longToByteArray(Double.doubleToRawLongBits(value));
|
byte[] | doubleToByteArrayBE(double data) Convert a double to a byte array (big endian). return longToByteArrayBE(Double.doubleToRawLongBits(data));
|
byte[] | doubleToBytes(double d) This function converts a double to its corresponding byte array format. byte[] buffer = new byte[8]; doubleToBytes(d, buffer, 0); return buffer; |
byte[] | doubleToBytes(double d) double To Bytes long l = Double.doubleToRawLongBits(d); byte[] r = new byte[8]; for (int i = 0; i < 8; i++) { r[i] = (byte) ((l >>> (i * 8)) & 0xFF); return r; |
byte[] | doubleToBytes(double d) double To Bytes return longToBytes(Double.doubleToLongBits(d));
|
byte[] | doubleToBytes(double d, byte[] bytes, int off, boolean bigEndian) double To Bytes return bigEndian ? doubleToBytesBE(d, bytes, off) : doubleToBytesLE(d, bytes, off);
|
void | doubleToBytes(double d, byte[] data, int[] offset) Write the bytes representing d into the byte array data , starting at index offset [0] , and increment offset [0] by the number of bytes written; if data == null , increment offset [0] by the number of bytes that would have been written otherwise.
long bits = Double.doubleToLongBits(d);
longToBytes(bits, data, offset);
|
int | doubleToBytes(double dnum, byte[] bytes, int startIndex) Given a double, convert it into a byte array return longToBytes(Double.doubleToLongBits(dnum), bytes, startIndex);
|
void | doubleToBytes(double v, byte[] bytes) double To Bytes doubleToBytes(v, bytes, 0); |
void | doubleToBytes(double v, byte[] bytes, int off) double To Bytes long el = Double.doubleToRawLongBits(v); int shift = 64; int lim = off + 8; for (int i = off; i < lim; i++) { shift -= 8; bytes[i] = (byte) ((el >> shift) & 0xFF); |