protected static String getBits ( int b ) { Formatter s = new Formatter ( ) ; for ( int i = 31 ; i >= 0 ; i -- ) { if ( ( b & ( 1 << i ) ) != 0 ) { s . format ( "1" ) ; } else { s . format ( "0" ) ; } if ( i % 8 == 0 ) { s . format ( "|" ) ; } } return s . toString ( ) ; }
Get a bit string for an integer