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