Java Convert via ByteBuffer toIntArray(byte[] byteArray)

Here you can find the source of toIntArray(byte[] byteArray)

Description

to Int Array

License

LGPL

Declaration

public static int[] toIntArray(byte[] byteArray) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static int[] toIntArray(byte[] byteArray) {
        int times = Integer.SIZE / Byte.SIZE;
        int[] doubles = new int[byteArray.length / times];
        for (int i = 0; i < doubles.length; i++) {
            doubles[i] = ByteBuffer.wrap(byteArray, i * times, times).getInt();
        }/*w w  w.j  ava 2 s  . c  o  m*/
        return doubles;
    }
}

Related

  1. toInt(byte[] data)
  2. toInt(byte[] value)
  3. toInt(final byte lowOrderByte, final byte highOrderByte)
  4. toInt(InetAddress address)
  5. toIntArray(byte[] byteArray)
  6. toIntArray(final byte[] byteArray)
  7. toIntArray(float[] floatArray)
  8. toIntBuffer(int[] array)
  9. toIntFromByteArray(byte[] byteArray)