Android Utililty Methods Byte Array to Int Convert

List of utility methods to do Byte Array to Int Convert

Description

The list of methods to do Byte Array to Int Convert are organized into topic(s).

Method

intbuildInt(byte first, byte second)
build Int
return (byte) ((second << 8) & 0xFF) + (first & 0xFF);
intextractInt(byte[] data, int offset)
extract Int
return (((data[offset + 0] & 0xff) << 0)
        | ((data[offset + 1] & 0xff) << 8)
        | ((data[offset + 2] & 0xff) << 16) | ((data[offset + 3] & 0xff) << 24));
intByteToInt(byte[] b)
Byte To Int
int targets = (b[0] & 0xff) | ((b[1] << 8) & 0xff00)
        | ((b[2] << 24) >>> 8) | (b[3] << 24);
return targets;
intbyteArray2Int(byte[] b)
byte Array Int
return (b[0] << 24) + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8)
        + (b[3] & 0xFF);
intbyteArray2Int1(byte[] b)
byte Array Int
return (b[0] & 0xFF);
intbyteArray2Int3(byte[] b)
byte Array Int
return ((b[0] & 0xFF) << 16) + ((b[1] & 0xFF) << 8) + (b[2] & 0xFF);
intbyte2Int(byte b)
byte Int
return (b & 0xFF);
Integerbyte2Integer(byte bin)
byte Integer
return (Integer) (bin & 0xFF);
Integerbyte2Integer(byte[] bin)
byte Integer
int mask = 0xff;
int temp = 0;
int n = 0;
int size = bin.length;
if (size <= 0) {
    return 0;
if (size < 2 && size > 0) {
...
intbyteArrayToInt(byte[] b)
byte Array To Int
return (b[0] << 24) + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8)
        + (b[3] & 0xFF);