Java Hex Calculate 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  www .  ja  va 2 s  .co 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. toHexChar(int digitValue)
  2. toHexChar(int digitValue)
  3. toHexChar(int i)
  4. toHexChar(int i)
  5. toHexChar(int i)
  6. toHexChar(int paramInt)
  7. toHexChar(int value)
  8. toHexCharArray(byte[] input)
  9. toHexCharFromBin(final String bin)