public static int decodeInt(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int value = (src[srcOffset] << 24) | ((src[srcOffset + 1] & 0xff) << 16) |
                ((src[srcOffset + 2] & 0xff) << 8) | (src[srcOffset + 3] & 0xff);
            return value ^ 0x80000000;
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
public static int decodeInt ( byte [ ] src , int srcOffset ) throws CorruptEncodingException { try { int value = ( src [ srcOffset ] << 24 ) | ( ( src [ srcOffset + 1 ] & 0xff ) << 16 ) | ( ( src [ srcOffset + 2 ] & 0xff ) << 8 ) | ( src [ srcOffset + 3 ] & 0xff ) ; return value ^ 0x80000000 ; } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; } }
Decodes a signed integer from exactly 4 bytes.

@param src source of encoded bytes
@param srcOffset offset into source array
@return signed integer value