Example usage for java.lang Integer toHexString

List of usage examples for java.lang Integer toHexString

Introduction

In this page you can find the example usage for java.lang Integer toHexString.

Prototype

public static String toHexString(int i) 

Source Link

Document

Returns a string representation of the integer argument as an unsigned integer in base 16.

Usage

From source file:Main.java

public static String toColorString(int color) {
    return "#" + Integer.toHexString(color).toUpperCase();
}

From source file:Main.java

public static String colourIntToHex(int aColour) {
    return "#" + Integer.toHexString(aColour);
}

From source file:Main.java

public static int byteToHexInt(byte b) {
    return Integer.parseInt(Integer.toHexString(b), 16);
}

From source file:Main.java

static String HF(float f) {
    return Integer.toHexString(Float.floatToIntBits(f));
}

From source file:Main.java

public static String decodeToHex(String data) {
    String string = Integer.toHexString(Integer.parseInt(data));
    return string;
}

From source file:Main.java

public static String create16Int(int strInt10) {
    String int16 = Integer.toHexString(strInt10);
    return "0x" + int16.toUpperCase();
}

From source file:Main.java

public static String toHexString(int num) {
    String string = "0x" + Integer.toHexString(num);
    return string;
}

From source file:Main.java

public static String unsignedIntToHexString(int b) {
    String hex = Integer.toHexString(b);
    for (int i = 0; i < 2 - hex.length(); i++) {
        hex = "0" + hex;
    }//ww  w  .ja va  2s.  co m
    return hex;
}

From source file:Main.java

public static String getETag(File file) {
    return Integer.toHexString((file.getAbsolutePath() + file.lastModified() + "" + file.length()).hashCode());
}

From source file:Main.java

public static String int2hex(int i) {
    String h = "";

    h = Integer.toHexString(i);
    if (h.length() == 1) {
        h = "0" + h;
    }//from  www. java  2  s . c o m
    return h;
}