question: public BitArray ( int length , byte [ ] a ) throws IllegalArgumentException { if ( length < 0 ) { throw new IllegalArgumentException ( "Negative length for BitArray" ) ; } if ( a . length * BITS_PER_UNIT < length ) { throw new IllegalArgumentException ( "Byte array too short to represent " + "bit array of given length" ) ; } this . length = length ; int repLength = ( ( length + BITS_PER_UNIT - 1 ) / BITS_PER_UNIT ) ; int unusedBits = repLength * BITS_PER_UNIT - length ; byte bitMask = ( byte ) ( 0xFF << unusedBits ) ; repn = new byte [ repLength ] ; System . arraycopy ( a , 0 , repn , 0 , repLength ) ; if ( repLength > 0 ) { repn [ repLength - 1 ] &= bitMask ; } }
target:  Creates a BitArray of the specified size, initialized from the specified byte array.  The most significant bit of a[0] gets index zero in the BitArray.  The array a must be large enough to specify a value for every bit in the BitArray.  In other words, 8*a.length <= length.