static int computeValidLevels(long bitPattern){
  return Long.bitCount(bitPattern);
}

static int computeValidLevels ( long bitPattern ) { return Long . bitCount ( bitPattern ) ; }
computes the number of valid levels above the base buffer
