2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.netconf.test.tool;
11 import java.io.InputStream;
13 public final class TestToolUtils {
15 public static String getMac(long mac) {
16 final StringBuilder builder = new StringBuilder(Long.toString(mac, 16));
17 for (int i = builder.length(); i < 12; i++) {
18 builder.insert(0, "0");
20 for (int j = builder.length() - 2; j >= 2; j -= 2) {
21 builder.insert(j, ":");
23 return builder.toString();
26 public static InputStream getDataAsStream(final String path) {
27 return TestToolUtils.class.getClassLoader().getResourceAsStream(path);