Here you can find the source of toInt(final List
public static int toInt(final List<Integer> digits, final int base)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.ListIterator; public class Main { public static int toInt(final List<Integer> digits, final int base) { int pos = 1; int retVal = 0; for (ListIterator<Integer> it = digits.listIterator(digits.size()); it .hasPrevious();) {/* w ww. j a v a 2s .c om*/ retVal += it.previous() * pos; pos = pos * base; } return retVal; } }