Here you can find the source of long2Mac(final long macAddress)
public static String long2Mac(final long macAddress)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.util.Formatter; public class Main { public static String long2Mac(final long macAddress) { final StringBuilder result = new StringBuilder(17); try (Formatter formatter = new Formatter(result)) { formatter.format("%02x:%02x:%02x:%02x:%02x:%02x", macAddress >> 40 & 0xff, macAddress >> 32 & 0xff, macAddress >> 24 & 0xff, macAddress >> 16 & 0xff, macAddress >> 8 & 0xff, macAddress & 0xff); }//from ww w .j av a2s . c o m return result.toString(); } }