Here you can find the source of toHexString(long l)
Parameter | Description |
---|---|
l | The long to convert. |
public static String toHexString(long l)
//package com.java2s; //License from project: BSD License public class Main { /**//from w w w . ja va 2 s . com * Convert a long to it's hex representation. Unlike * {@ Long#toHexString(long)} this always returns 16 digits. * @param l The long to convert. * @return l in hex. */ public static String toHexString(long l) { String initial; StringBuffer sb; initial = Long.toHexString(l); if (initial.length() == 16) return initial; sb = new StringBuffer(16); sb.append(initial); while (sb.length() < 16) sb.insert(0, '0'); return sb.toString(); } }