Java Integer Create toIntArray(byte[] data, boolean includeLength)

Here you can find the source of toIntArray(byte[] data, boolean includeLength)

Description

to Int Array

License

Open Source License

Declaration

private static int[] toIntArray(byte[] data, boolean includeLength) 

Method Source Code

//package com.java2s;

public class Main {
    private static int[] toIntArray(byte[] data, boolean includeLength) {
        int n = (((data.length & 3) == 0) ? (data.length >>> 2)
                : ((data.length >>> 2) + 1));
        int[] result;

        if (includeLength) {
            result = new int[n + 1];
            result[n] = data.length;/*from w  ww .  ja v a 2s.c  o m*/
        } else {
            result = new int[n];
        }
        n = data.length;
        for (int i = 0; i < n; ++i) {
            result[i >>> 2] |= (0x000000ff & data[i]) << ((i & 3) << 3);
        }
        return result;
    }
}

Related

  1. toIntArray(boolean[] selectedValues)
  2. toIntArray(byte[] byteArray)
  3. toIntArray(byte[] bytes)
  4. toIntArray(byte[] data)
  5. toIntArray(byte[] data)
  6. toIntArray(byte[] data, int offset)
  7. toIntArray(byte[] input)
  8. toIntArray(double[] a)
  9. toIntArray(double[] array)