Java Integer to Hex intToHex(int id)

Here you can find the source of intToHex(int id)

Description

int To Hex

License

Apache License

Declaration

private static String intToHex(int id) 

Method Source Code

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

public class Main {
    private static String intToHex(int id) {
        if (id < 0x10) {
            return "0" + Integer.toHexString(id);
        } else {//w w w .j a va 2  s. c o m
            return Integer.toHexString(id);
        }
    }

    private static String intToHex(long _id) {
        int id = (int) _id;
        if (id < 0x10) {
            return "0" + Integer.toHexString(id);
        } else {
            return Integer.toHexString(id);
        }
    }
}

Related

  1. intToHex(int a)
  2. intToHex(int i)
  3. intToHex(int i)
  4. intToHex(int i)
  5. IntToHex(int i, int length)
  6. intToHex(int num)
  7. intToHex(int val)
  8. intToHex(int val, char delim)
  9. intToHex(int val, StringBuffer sb)