Java Byte Array to Int bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size)

Here you can find the source of bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size)

Description

bytes To Int Arr

License

Open Source License

Declaration

public static int[] bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final int INT_SIZE = 4;

    public static int[] bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size) {
        for (int i = 0; i < size; ++i) {
            int off = offset + (i * INT_SIZE);

            num[soff + i] = (int) ((arr[off + 0] & 0xFF) << 24) | (int) ((arr[off + 1] & 0xFF) << 16)
                    | (int) ((arr[off + 2] & 0xFF) << 8) | (int) ((arr[off + 3] & 0xFF) << 0);
        }/*from   w  w w  .  jav  a2 s .  c om*/

        return num;
    }
}

Related

  1. bytesToInt(final byte[] bytes)
  2. bytesToInt(final byte[] bytes, final int position, final int length, final int bitShiftStart, final int bitShitIncrement)
  3. bytesToInt(int off, byte... arr)
  4. bytesToInt16(byte highByte, byte lowByte)
  5. bytesToInt2(byte[] arr, int offset)
  6. bytesToInteger(byte[] b)
  7. bytesToInteger(byte[] b, int off)
  8. bytesToInteger(byte[] bytes)
  9. bytesToInts(byte[] a, int ao, int[] b, int bo, int len)