public static boolean isAligned ( final long address , final int alignment ) { if ( ! BitUtil . isPowerOfTwo ( alignment ) ) { throw new IllegalArgumentException ( "alignment must be a power of 2: alignment=" + alignment ) ; } return ( address & ( alignment - 1 ) ) == 0 ; }
Is an address aligned on a boundary .