Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to convert byte array to int array

Java: How to convert byte array to int array
{filelink=4678}

public class Tab_Conversion
 {
    public static int[] byte2int(byte[]byte_Tab)
    {
        int intTab_lenght = byte_Tab.length >>> 2;
        int[]int_Tab = new int[intTab_lenght];
        for (int i=0; i<intTab_lenght; i++) {
            int j = i << 2;
            int x = 0;
            x += (byte_Tab[j++] &#038; 0xff) << 0;
            x += (byte_Tab[j++] &#038; 0xff) << 8;
            x += (byte_Tab[j++] &#038; 0xff) << 16;
            x += (byte_Tab[j++] &#038; 0xff) << 24;
            int_Tab[i] = x;
        }
        return int_Tab;
    }
}

Users who found this page were searching for:

  • java send integer array network
  • convert byte array index value into integer
  • java bytes to structure
  • int to byte array 2012 java
  • java byte array to int
  • php convert "byte array to int array"

No comments yet.

Leave a Comment