Java Hex Calculate toHexChars(final int b)

Here you can find the source of toHexChars(final int b)

Description

to Hex Chars

License

Open Source License

Declaration

private static char[] toHexChars(final int b) 

Method Source Code

//package com.java2s;

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

    private static char[] toHexChars(final int b) {
        final char left = HEX_DIGITS[(b >>> 4) & 0x0F];
        final char right = HEX_DIGITS[b & 0x0F];
        return new char[] { left, right };
    }/*ww w  .  j  a va 2 s . c om*/
}

Related

  1. toHexChar(int value)
  2. toHexCharArray(byte[] input)
  3. toHexCharFromBin(final String bin)
  4. toHexChars(byte[] bs)
  5. toHexChars(byte[] bytes)
  6. toHexDec(byte[] bytes)
  7. toHexDigit(char ch)
  8. toHexDigit(char ch, int index)
  9. toHexDigit(int d)