Here you can find the source of longToString(long longValue, boolean noCase)
public static String longToString(long longValue, boolean noCase)
//package com.java2s; public class Main { private static final char[] DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" .toCharArray();//from w ww. ja v a 2 s. c om private static final char[] DIGITS_NOCASE = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); public static String longToString(long longValue) { return longToString(longValue, false); } public static String longToString(long longValue, boolean noCase) { char[] digits = noCase ? DIGITS_NOCASE : DIGITS; int digitsLength = digits.length; if (longValue == 0) { return String.valueOf(digits[0]); } if (longValue < 0) { longValue = -longValue; } StringBuilder strValue = new StringBuilder(); while (longValue != 0) { int digit = (int) (longValue % digitsLength); longValue = longValue / digitsLength; strValue.append(digits[digit]); } return strValue.toString(); } }