ActionConvertor:ActionBuilder one instance is now removed,locally object are created...
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / ByteUtil.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.openflow.md.core;
9
10 /**
11  * @author mirehak
12  *
13  */
14 public abstract class ByteUtil {
15
16     
17     /**
18      * @param bytes
19      * @param delimiter
20      * @return hexString containing bytes, separated with delimiter
21      */
22     public static String bytesToHexstring(byte[] bytes, String delimiter) {
23         StringBuffer sb = new StringBuffer();
24         for (int i = 0; i < bytes.length; i++) {
25             byte b = bytes[i];
26             sb.append(String.format("%02x%s", b, delimiter));
27         }
28         return sb.toString();
29     }
30 }