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