Here you can find the source of getNetworkInterfaceInfo(NetworkInterface pNif)
private static String getNetworkInterfaceInfo(NetworkInterface pNif) throws SocketException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import java.net.*; public class Main { private static Method isUp; private static Method supportsMulticast; private static String getNetworkInterfaceInfo(NetworkInterface pNif) throws SocketException { if (pNif == null) { return "[null]"; }/* w w w. j av a 2 s .c om*/ return pNif.getDisplayName() + " [up: " + pNif.isUp() + ", mc: " + pNif.supportsMulticast() + ", lb: " + pNif.isLoopback() + ", hw: " + formatHwAddress(pNif.getHardwareAddress()) + "]"; } private static String formatHwAddress(byte[] pHardwareAddress) { if (pHardwareAddress == null) { return "[none]"; } StringBuilder sb = new StringBuilder(18); for (byte b : pHardwareAddress) { if (sb.length() > 0) { sb.append(':'); } sb.append(String.format("%02x", b)); } return sb.toString(); } }