@Test public void testBytesToMac(){ byte[] macBytes = {0,1,0,1,0,1}; assertEquals(new MacAddress("00:01:00:01:00:01"), ArpUtils.bytesToMac(macBytes)); assertNull(ArpUtils.bytesToMac(null)); }
public static @Nullable MacAddress bytesToMac(byte[] macBytes) { String mac = HexEncode.bytesToHexStringFormat(macBytes); if (!"null".equals(mac)) { return new MacAddress(mac); } return null; }
ArpUtils { public static @Nullable MacAddress bytesToMac(byte[] macBytes) { String mac = HexEncode.bytesToHexStringFormat(macBytes); if (!"null".equals(mac)) { return new MacAddress(mac); } return null; } }
ArpUtils { public static @Nullable MacAddress bytesToMac(byte[] macBytes) { String mac = HexEncode.bytesToHexStringFormat(macBytes); if (!"null".equals(mac)) { return new MacAddress(mac); } return null; } private  ArpUtils(); }
ArpUtils { public static @Nullable MacAddress bytesToMac(byte[] macBytes) { String mac = HexEncode.bytesToHexStringFormat(macBytes); if (!"null".equals(mac)) { return new MacAddress(mac); } return null; } private  ArpUtils(); static String getArpFrameToStringFormat(Ethernet eth); static String getArpToStringFormat(Arp arp); static byte[] macToBytes(MacAddress mac); static @Nullable MacAddress bytesToMac(byte[] macBytes); static byte[] ipToBytes(Ipv4Address ip); static @Nullable Ipv4Address bytesToIp(byte[] ipv4AsBytes); }
ArpUtils { public static @Nullable MacAddress bytesToMac(byte[] macBytes) { String mac = HexEncode.bytesToHexStringFormat(macBytes); if (!"null".equals(mac)) { return new MacAddress(mac); } return null; } private  ArpUtils(); static String getArpFrameToStringFormat(Ethernet eth); static String getArpToStringFormat(Arp arp); static byte[] macToBytes(MacAddress mac); static @Nullable MacAddress bytesToMac(byte[] macBytes); static byte[] ipToBytes(Ipv4Address ip); static @Nullable Ipv4Address bytesToIp(byte[] ipv4AsBytes);  }