base/common/src/main/com/thesett/common/util/ByteBufferUtils.java
public static int getIntFromBytes(byte[] buf, int offset)
    {
        int result = 0;

        result += buf[offset++] & 0xFF;
        result += ((buf[offset++] & 0xFF) << 8);
        result += ((buf[offset++] & 0xFF) << 16);
        result += ((buf[offset]) << 24);

        return result;
    }
public static int getIntFromBytes(byte[] buf, int offset)
    {
        int result = 0;

        result += buf[offset++] & 0xFF;
        result += ((buf[offset++] & 0xFF) << 8);
        result += ((buf[offset++] & 0xFF) << 16);
        result += ((buf[offset]) << 24);

        return result;
    }
Extracts an int from an array of bytes.

@param  buf    The array of bytes to extract the int from.
@param  offset The offset of the start of the int in the byte array.

@return An integer extracted from the 4 bytes of data.