Java Byte to Hex byteToHex(byte b)

Here you can find the source of byteToHex(byte b)

Description

Returns the hexadecimal representation of a byte.

License

Open Source License

Parameter

Parameter Description
b - the byte to format as a hexadecimal String.

Return

the hexadecimal representation of the given byte.

Declaration

public static String byteToHex(byte b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w  w w . j ava 2s  . c om*/
     * Returns the hexadecimal representation of a byte.
     *
     * @param b - the byte to format as a hexadecimal String.
     * @return the hexadecimal representation of the given byte.
     */
    public static String byteToHex(byte b) {
        return String.format("%02X", b);
    }
}

Related

  1. byteToHex(byte a)
  2. byteToHex(byte b)
  3. byteToHex(byte b)
  4. byteToHex(byte b)
  5. byteToHex(byte b)
  6. byteToHex(byte b)
  7. byteToHex(byte b)
  8. byteToHex(byte b)
  9. byteToHex(byte b)