public static void appendBitStrings ( BitVector bv , String [ ] bs ) { for ( String s : bs ) { if ( s . length ( ) != 8 ) throw new RuntimeException ( "The length of bit string must be 8 while " + s . length ( ) ) ; for ( char c : s . toCharArray ( ) ) { if ( c == ' ' ) bv . append0 ( ) ; else if ( c == ' ' ) bv . append1 ( ) ; else throw new RuntimeException ( "invalid char '" + c + "' for bit string." ) ; } } }
Append bits from bit string . The bit string is the array of string that contains 8 characters which is 0 or 1 .