Here you can find the source of alignSize(long size, long alignment)
static long alignSize(long size, long alignment)
//package com.java2s; public class Main { static long alignSize(long size, long alignment) { if (alignment > 1) { long r = size % alignment; if (r != 0) { size += alignment - r;/*from w w w . j av a2 s . c om*/ } } return size; } }