Here you can find the source of byteToDouble(byte[] paramArrayOfByte)
Parameter | Description |
---|---|
paramArrayOfByte | Byte of packet |
public static double[] byteToDouble(byte[] paramArrayOfByte)
//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; } }