Here you can find the source of roundUp(long position, long sectionAlignment)
public static long roundUp(long position, long sectionAlignment)
//package com.java2s; public class Main { public static long roundUp(long position, long sectionAlignment) { if (sectionAlignment < 0) throw new RuntimeException("Bad alignment: " + sectionAlignment); if (sectionAlignment == 0) sectionAlignment = 1;/*ww w .ja v a 2 s . c o m*/ if (position % sectionAlignment != 0) return (position - (position % sectionAlignment)) + sectionAlignment; return position; } }