DHCP Handling for TOR VM
[vpnservice.git] / dhcpservice / dhcpservice-api / src / main / java / org / opendaylight / vpnservice / dhcpservice / api / DHCPUtils.java
index 167e8077bf783fa9e4e1e28a0548f99931242ec0..99f7a7f6ecb56fdf479e5fc3f7033377c5ed735a 100644 (file)
@@ -86,4 +86,14 @@ public abstract class DHCPUtils {
         return result;
     }
 
+    public static String byteArrayToString(byte[] bytes) {
+        StringBuilder str = new StringBuilder();
+        for (byte b : bytes) {
+            str.append(Integer.toHexString((b >>> 4) & 0x0F));
+            str.append(Integer.toHexString(b & 0x0F));
+            str.append(":");
+        }
+        str.deleteCharAt(str.lastIndexOf(":"));
+        return str.toString();
+    }
 }