Java Formatter Usage byte2Mac(final byte[] m)

Here you can find the source of byte2Mac(final byte[] m)

Description

byte Mac

License

Apache License

Declaration

public static String byte2Mac(final byte[] m) 

Method Source Code

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one

import java.util.Formatter;

public class Main {
    public static String byte2Mac(final byte[] m) {
        final StringBuilder result = new StringBuilder(17);
        final Formatter formatter = new Formatter(result);
        formatter.format("%02x:%02x:%02x:%02x:%02x:%02x", m[0], m[1], m[2],
                m[3], m[4], m[5]);//from   www  . j a  v  a  2 s.  co m
        formatter.close();
        return result.toString();
    }
}

Related

  1. alterationValueToString(double value)
  2. append(final CharSequence seq, final Formatter formatter, final int flags, final int width, final int precision)
  3. asFormattedStr(String format, String eol, Object... objects)
  4. assertion(final boolean test, final String fmt, final Object... params)
  5. byteArray2Hex(byte[] hash)
  6. byteArray2Hex(final byte[] hash)
  7. byteArray2HexString(byte[] buf)
  8. byteArrayToHex(final byte[] hash)