Here you can find the source of formatAsHex(long msgId)
public static String formatAsHex(long msgId)
//package com.java2s; //License from project: Apache License public class Main { public static String formatAsHex(long msgId) { String msgIdStr = String.format("%07x", msgId); return msgIdStr.toLowerCase(); // just to be sure :) }/* www .java2 s . co m*/ }