Here you can find the source of LongToHexString(final long value)
public final static String LongToHexString(final long value)
//package com.java2s; //License from project: Creative Commons License public class Main { public final static String LongToHexString(final long value) { final String string = Long.toString(value, 16).toUpperCase(); if (string.charAt(0) == '-') { return "-0X" + string.substring(1, string.length()) + "L"; } else {/* www . ja va 2s .c o m*/ return "0X" + string + "L"; } } }