Java Byte Array to Double byteToDouble(byte[] paramArrayOfByte)

Here you can find the source of byteToDouble(byte[] paramArrayOfByte)

Description

Convert byte packet to array double.

License

Apache License

Parameter

Parameter Description
paramArrayOfByte Byte of packet

Return

Array of double

Declaration

public static double[] byteToDouble(byte[] paramArrayOfByte) 

Method Source Code

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

public class Main {
    /**/*from   ww  w.j  a v a 2  s  . co  m*/
     * Convert byte packet to array double.
     * 
     * @param paramArrayOfByte Byte of packet
     * @return Array of double
     */
    public static double[] byteToDouble(byte[] paramArrayOfByte) {
        double[] arrayOfDouble = new double[paramArrayOfByte.length / 4];
        for (int i3 = 0; i3 < arrayOfDouble.length; i3++) {
            double d1 = Float.intBitsToFloat(paramArrayOfByte[(i3 << 2)]
                    & 0xFF
                    | (paramArrayOfByte[((i3 << 2) + 1)] & 0xFF) << 8
                    | (paramArrayOfByte[((i3 << 2) + 2)] & 0xFF) << 16
                    | (paramArrayOfByte[((i3 << 2) + 3)] & 0xFF) << 24);
            arrayOfDouble[i3] = d1;
        }
        return arrayOfDouble;
    }
}

Related

  1. bytesToDouble(byte[] data, int[] offset)
  2. bytesToDouble(final byte[] bytes)
  3. bytesToDoubles(byte[] b)
  4. byteToDouble(byte[] b)
  5. byteToDouble(byte[] bytes)
  6. byteToDoubleArray(byte[] ar)