Java Utililty Methods Integer to

List of utility methods to do Integer to

Description

The list of methods to do Integer to are organized into topic(s).

Method

StringIntToEnode62(Integer int10)
Int To Enode
String s62 = "";
int r = 0;
while (int10 != 0) {
    r = int10 % 62;
    s62 = str62keys[r] + s62;
    int10 = (int) Math.floor(int10 / 62.0);
return s62;
...
StringIntToEnode62(Integer int10)
Int To Enode
String s62 = "";
int r = 0;
while (int10.intValue() != 0) {
    r = Integer.parseInt(String.valueOf(int10.intValue() % 62));
    s62 = str62keys.charAt(r) + s62;
    String s = String.valueOf(Math.floor(int10.intValue() / 62));
    s = s.substring(0, s.length() - 2);
    int10 = Integer.valueOf(Integer.parseInt(s));
...
StringintToFixedLengthString(int value, int length)
Converts the given integer to a fixed length string by adding leading zeros to the given number that its length equals to the given length.
return String.format("%0" + length + "d", value);
voidintToFourByte(long value, byte[] dest, int off)
int To Four Byte
if ((value < 0) || (value > MAX_32BITS))
    throw new IllegalArgumentException(String.format(ERR_VALUE_OOB, value));
dest[off + 0] = (byte) ((value & 0xFF000000L) >> 24);
dest[off + 1] = (byte) ((value & 0x00FF0000L) >> 16);
dest[off + 2] = (byte) ((value & 0x0000FF00L) >> 8);
dest[off + 3] = (byte) ((value & 0x000000FFL));
byte[]intToFourBytes(int i)
int To Four Bytes
byte[] res = new byte[4];
res[0] = (byte) (i >>> 24);
res[1] = (byte) ((i >>> 16) & 0xFF);
res[2] = (byte) ((i >>> 8) & 0xFF);
res[3] = (byte) (i & 0xFF);
return res;
voidintToFourBytes(int iValue, byte b[], int offset)
int To Four Bytes
b[offset++] = (byte) ((iValue) & 0xff);
b[offset++] = (byte) ((iValue >>> 8) & 0xff);
b[offset++] = (byte) ((iValue >>> 16) & 0xff);
b[offset++] = (byte) ((iValue >>> 24) & 0xff);
StringintToFourChars(int value)
int To Four Chars
char[] chars = { (char) (0xFF & (value >> 24)), (char) (0xFF & (value >> 16)), (char) (0xFF & (value >> 8)),
        (char) (0xFF & value) };
return new String(chars);
StringintToGoodBadSimple(int i)
int To Good Bad Simple
switch (i) {
case 0:
    return "Good";
case 1:
    return "Normal";
case 2:
    return "Bad";
return "Normal";
StringintToID(int ID)
int To ID
String ret = "";
for (int i = 0; i < 4; i++) {
    ret = (char) ((ID >> (i * 8)) & 0xFF) + ret;
return ret;
Integer[]intToInteger(int[] array)
int To Integer
if (array == null) {
    return null;
} else {
    Integer[] newArray = new Integer[array.length];
    for (int i = 0; i < newArray.length; i++) {
        newArray[i] = array[i];
    return newArray;
...