Java Byte to Hex String byteToHexString(byte ib)

Here you can find the source of byteToHexString(byte ib)

Description

byte To Hex String

License

Apache License

Declaration

protected static String byteToHexString(byte ib) 

Method Source Code

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

public class Main {

    protected static String byteToHexString(byte ib) {
        char[] Digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
        char[] ob = new char[2];
        ob[0] = Digit[(ib >>> 4) & 0X0f];
        ob[1] = Digit[ib & 0X0F];/*from w  ww. j a v  a  2  s .  c om*/
        String s = new String(ob);
        return s;
    }
}

Related

  1. byteToHexString(byte b)
  2. byteToHexString(byte b)
  3. byteToHexString(byte bytes[])
  4. byteToHexString(byte data)
  5. byteToHexString(byte data)
  6. byteToHexString(byte in)
  7. byteToHexString(byte num)
  8. byteToHexString(byte src)
  9. byteToHexString(byte value)