Here you can find the source of convertByteArrayToLongArray(byte[] bytes)
Parameter | Description |
---|---|
bytes | a parameter |
public static long[] convertByteArrayToLongArray(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { /**/*w ww. j a v a2 s .c o m*/ * Converts a byte array to a long array. * @param bytes * @return */ public static long[] convertByteArrayToLongArray(byte[] bytes) { if (bytes == null) return null; int count = bytes.length / 8; long[] longArray = new long[count]; ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); for (int i = 0; i < count; i++) { longArray[i] = byteBuffer.getLong(); } return longArray; } }