Here you can find the source of convertByteArrayToDoubleArray(byte[] bytes)
Parameter | Description |
---|---|
bytes | a parameter |
public static double[] convertByteArrayToDoubleArray(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { /**//w w w . ja va 2 s . c om * Converts a byte array to a double array. * @param bytes * @return */ public static double[] convertByteArrayToDoubleArray(byte[] bytes) { if (bytes == null) return null; int count = bytes.length / 8; double[] doubleArray = new double[count]; ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); for (int i = 0; i < count; i++) { doubleArray[i] = byteBuffer.getDouble(); } return doubleArray; } }