Android examples for java.lang:Byte Array
Convert byte array To Int with shift and bit and
public class Main{ public static int bytesToInt(byte[] bytes) { int num = bytes[0] & 0xFF; num |= ((bytes[1] << 8) & 0xFF00); num |= ((bytes[2] << 16) & 0xFF0000); num |= ((bytes[3] << 24) & 0xFF000000); return num; }//w w w . j av a 2 s.c o m }