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