public static final int readBits ( int [ ] in , final int inOffset , final int bits ) { final int index = inOffset >>> 5 ; final int skip = inOffset & 0x1f ; int val = in [ index ] >>> skip ; if ( 32 - skip < bits ) { val |= ( in [ index + 1 ] << ( 32 - skip ) ) ; } return val & ( 0xffffffff >>> ( 32 - bits ) ) ; }
Read a certain number of bits of an integer into an integer array starting from the given start offset