Java Hex Calculate toHexUtil(int n)

Here you can find the source of toHexUtil(int n)

Description

to Hex Util

License

Apache License

Declaration

private static String toHexUtil(int n) 

Method Source Code

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

public class Main {
    private static String toHexUtil(int n) {
        String rt = "";
        switch (n) {
        case 10:/*from w  w w .  ja  va 2  s  .com*/
            rt += "A";
            break;
        case 11:
            rt += "B";
            break;
        case 12:
            rt += "C";
            break;
        case 13:
            rt += "D";
            break;
        case 14:
            rt += "E";
            break;
        case 15:
            rt += "F";
            break;
        default:
            rt += n;
        }
        return rt;
    }
}

Related

  1. toHexStringBE(char[] array)
  2. toHexStringLE(byte n)
  3. toHexStringUpperCase(byte[] b)
  4. toHexTable(byte[] byteSrc, int lengthOfLine)
  5. toHexText(byte[] bytes, int length)
  6. toHexValue(int number)
  7. toHexWithMarker(byte b)