Android Byte Array to Hex Convert byteToHexString(Byte b)

Here you can find the source of byteToHexString(Byte b)

Description

Converts a byte to the HEX String representation.

Parameter

Parameter Description
b The byte passed in which will be parsed to HEX representation.

Return

String in HEX notation which represents one byte.

Declaration

public static String byteToHexString(Byte b) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  www  . jav  a 2  s .co  m
     * Converts a byte to the HEX String representation.
     *
     * @param b The byte passed in which will be parsed to HEX representation.
     * @return String in HEX notation which represents one byte.
     */
    public static String byteToHexString(Byte b) {
        return String.format("%02X", b);
    }
}

Related

  1. byte2hex(byte[] buffer)
  2. byte2hex(byte[] buffer, int len)
  3. byte2hexWithoutSpace(byte[] buffer)
  4. byteArrayToHexString(byte[] b)
  5. byteArrayToHexString(final byte[] array)
  6. byteToHexString(byte b)
  7. byteToHexString(byte value)
  8. bytesToHex(byte[] bytes)
  9. bytesToHex(byte[] bytes)