Java Byte to Hex String byteToHexString(byte b)

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

Description

byte To Hex String

License

Apache License

Declaration

private static String byteToHexString(byte b) 

Method Source Code

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

public class Main {
    private static final char[] ac = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
            'f' };

    private static String byteToHexString(byte b) {
        char[] ch = new char[2];
        ch[0] = ac[(b >>> 4 & 0xF)];
        ch[1] = ac[(b & 0xF)];/*w ww .  j  ava  2  s  .  c o  m*/
        String s = new String(ch);
        return new String(ch);
    }
}

Related

  1. byteToHexString(byte b)
  2. byteToHexString(byte b)
  3. byteToHexString(byte b)
  4. byteToHexString(byte b)
  5. byteToHexString(byte b)
  6. byteToHexString(byte bytes[])
  7. byteToHexString(byte data)
  8. byteToHexString(byte data)
  9. byteToHexString(byte ib)