Java tutorial
//package com.java2s; //License from project: Apache License public class Main { private static String formatAddress(byte[] addr) { StringBuilder buf = new StringBuilder(24); for (byte b : addr) { buf.append(String.format("%02x:", b & 0xff)); } return buf.substring(0, buf.length() - 1); } }