Java Integer to Hex int2CharHex(int integer)

Here you can find the source of int2CharHex(int integer)

Description

int Char Hex

License

Open Source License

Declaration

public static String int2CharHex(int integer) 

Method Source Code

//package com.java2s;

public class Main {
    private static char[] hexval = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
            'F' };

    public static String int2CharHex(int integer) {
        int low = integer & 0xF;
        int high = (integer >> 4) & 0xF;
        return (Character.toString(hexval[high]) + Character.toString(hexval[low]));
    }/*from  w w w .  j  a v  a2  s  .c  om*/
}

Related

  1. asHex(int i, int width)
  2. asHex(int val)
  3. convertIntArrayToHexString(int[] arr)
  4. convertIntToHex(int i)
  5. convertInttoHexa(int n)
  6. int2hex(final int a, final StringBuffer str)
  7. int2hex(final int i)
  8. int2hex(int a, StringBuffer str)
  9. int2hex(int i)