Android Byte Array to Int Convert byteArrayToInt(byte[] b)

Here you can find the source of byteArrayToInt(byte[] b)

Description

byte Array To Int

License

Open Source License

Declaration

public static int byteArrayToInt(byte[] b) 

Method Source Code

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

public class Main {
    public static int byteArrayToInt(byte[] b) {
        return b[3] & 0xFF | (b[2] & 0xFF) << 8 | (b[1] & 0xFF) << 16
                | (b[0] & 0xFF) << 24;
    }/*from  w  w  w. java 2 s.com*/
}

Related

  1. toInt(byte[] src, int srcPos)
  2. toIntFromTwoBytes(byte[] b, int pos)
  3. toInteger(byte[] b, int pos)
  4. toInteger(byte[] b, int pos, int width)
  5. toInts(byte... bytes)
  6. bytes2int(byte[] data)
  7. byte2int(byte[] b)
  8. byteArray2Int(byte[] bs)
  9. byteArrayToInt(byte[] b)