public static int extract ( int bs , int low , int high ) { bs = bs >> low ; int mask = 0 ; for ( int i = 0 ; i < ( high - low ) ; i ++ ) { mask += 1 << i ; } return bs & mask ; }
Get part of one integer as a new integer