Java - Convert numbers into any base