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

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

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

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

        return i;
    }
public static int get24BitIntFromBytes ( byte [ ] buf , int offset ) { int i = 0 ; offset ++ ; i += buf [ offset ++ ] & 0xFF ; i += ( ( buf [ offset ++ ] & 0xFF ) << 8 ) ; i += ( ( buf [ offset ] & 0xFF ) << 16 ) ; return i ; }
Extracts an int from an array of bytes. Only three bytes are pulled together from the array to make a 24 bit
integer, albeit returned as a java 32 bit int.

@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.
Extracts an int from an array of bytes . Only three bytes are pulled together from the array to make a 24 bit integer albeit returned as a java 32 bit int .