Mega Code Archive

 
Categories / Android / Date Type
 

Byte Array To Int

class Utils {      public final static int byteArrayToInt(byte[] b) {           if (b.length != 4) {               return 0;           }           // little endian           int i = (((b[3] & 0xff) << 24) | ((b[2] & 0xff) << 16) | ((b[1] & 0xff) << 8)                    | (b[0] & 0xff));                  return i;       } }