Here you can find the source of roundPower2(final long x)
public static long roundPower2(final long x)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww. j a v a 2 s .com * Finds greater nearest number that is power of 2 * @return long */ public static long roundPower2(final long x) { int rval = 256; while (rval < x) rval <<= 1; return rval; } }