Java Byte to Hex byteToHex(byte b)

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

Description

byte To Hex

License

Apache License

Declaration

public static String byteToHex(byte b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String byteToHex(byte b) {
        // Returns hex String representation of byte b
        char hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
        char[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };
        return new String(array);
    }/*  ww  w. j  a v a2s  .  c  o m*/
}

Related

  1. byteToHex(byte b)
  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, StringBuffer buf)
  9. byteToHex(byte bytevalue)