public static void checkPageSize ( final int pageSize ) { if ( pageSize < PAGE_MIN_SIZE ) { throw new IllegalStateException ( "Page size less than min size of " + PAGE_MIN_SIZE + ": page size=" + pageSize ) ; } if ( pageSize > PAGE_MAX_SIZE ) { throw new IllegalStateException ( "Page size more than max size of " + PAGE_MAX_SIZE + ": page size=" + pageSize ) ; } if ( ! BitUtil . isPowerOfTwo ( pageSize ) ) { throw new IllegalStateException ( "Page size not a power of 2: page size=" + pageSize ) ; } }
Check that page size is valid and alignment is valid .