Java Byte Array to Double bytesToDoubles(byte[] b)

Here you can find the source of bytesToDoubles(byte[] b)

Description

bytes To Doubles

License

Open Source License

Declaration

public static double[] bytesToDoubles(byte[] b) 

Method Source Code

//package com.java2s;
/** Ben F Rayfield offers this software opensource MIT license */

public class Main {
    public static double[] bytesToDoubles(byte[] b) {
        double[] d = new double[b.length >> 3];
        for (int i = 0; i < d.length; i++) {
            d[i] = Double.longBitsToDouble(readLongFromByteArray(b, i << 3));
        }//from  w  w w .j  a v  a2s .  c om
        return d;
    }

    public static long readLongFromByteArray(byte[] b, int byteIndex) {
        long j = 0;
        for (int i = 0; i < 8; i++) {
            j = (j << 8) | (b[byteIndex + i] & 0xff);
        }
        return j;
    }
}

Related

  1. bytesToDouble(byte[] bytes, int off)
  2. bytesToDouble(byte[] bytes, int offset)
  3. bytesToDouble(byte[] bytes, int startIndex)
  4. bytesToDouble(byte[] data, int[] offset)
  5. bytesToDouble(final byte[] bytes)
  6. byteToDouble(byte[] b)
  7. byteToDouble(byte[] bytes)
  8. byteToDouble(byte[] paramArrayOfByte)
  9. byteToDoubleArray(byte[] ar)