Here you can find the source of maxValue(byte length)
public static long maxValue(byte length)
//package com.java2s; //License from project: Open Source License public class Main { public static long maxValue(byte length) { return (long) Math.pow(2, Byte.SIZE * length - 1); }/*from www.j ava 2 s . co m*/ }