Android Hex String Create toHexChar(int nibble)

Here you can find the source of toHexChar(int nibble)

Description

Convert a nibble to a hex character

License

Open Source License

Parameter

Parameter Description
nibble the nibble to convert.

Declaration

public static char toHexChar(int nibble) 

Method Source Code

//package com.java2s;

public class Main {
    /** A table of hex digits */
    public static final char[] hexDigit = { '0', '1', '2', '3', '4', '5',
            '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

    /**/*from w  w  w  . ja va 2  s  .c o m*/
     * Convert a nibble to a hex character
     * 
     * @param nibble
     *          the nibble to convert.
     */
    public static char toHexChar(int nibble) {
        return hexDigit[(nibble & 0xF)];
    }
}

Related

  1. appendHex(StringBuffer sb, byte b)
  2. isHexChar(char ch)
  3. isHexChar(String hexString, boolean checkSpaceFlag)
  4. isHexChar(String hexString)
  5. appendHex(final StringBuffer buf, final byte i)
  6. appendHex(final StringBuffer buf, final int i)
  7. toHex(final int i)
  8. appendHexJavaScriptRepresentation(int codePoint, Appendable out)