Here you can find the source of alignUp(long b, long a)
static public long alignUp(long b, long a)
//package com.java2s; public class Main { /**/*from ww w .ja v a 2 s. com*/ * Example: alignUp( 700, 512 ) -> 1024 */ static public long alignUp(long b, long a) { return (long) (Math.ceil((double) b / a) * a); } }