List of utility methods to do Integer Convert To
String | IntegerTo(Integer i) Integer To String str = ""; if (i.intValue() < 10) { str = "0" + i; } else { str = String.valueOf(i); return str; |
String | integerToASCII(int number) integer To ASCII char[] ascii = new char[8]; ascii[0] = (char) (((number & 0xF0000000) >>> 28) + 97); ascii[1] = (char) (((number & 0x0F000000) >>> 24) + 97); ascii[2] = (char) (((number & 0x00F00000) >>> 20) + 97); ascii[3] = (char) (((number & 0x000F0000) >>> 16) + 97); ascii[4] = (char) (((number & 0x0000F000) >>> 12) + 97); ascii[5] = (char) (((number & 0x00000F00) >>> 8) + 97); ascii[6] = (char) (((number & 0x000000F0) >>> 4) + 97); ... |
byte[] | integerToByte(int i) integer To Byte byte[] buffer = new byte[4]; buffer[0] = (byte) (i); buffer[1] = (byte) (i >> 8); buffer[2] = (byte) (i >> 16); buffer[3] = (byte) (i >> 24); return buffer; |
char | IntegerTochar(final Integer value) Integer Tochar return (char) value.intValue(); |
float | integerToFloat(float f, int i, float offset, boolean rotate) integer To Float if (rotate) { float v = f + i / (2 * offset); if (v < 0.0f) { return v + 1.0f; } else if (v > 1.0f) { return v - 1.0f; } else { return v; ... |
int[] | IntegerToInt(Integer[] in) Integer To Int int[] nope = new int[in.length]; for (int i = 0; i < in.length; i++) nope[i] = in[i]; return nope; |
byte[] | integerToLittleEndian(byte[] buf, int offset, long value, int numBytes) Converts a integral value to the corresponding little endian array. for (int i = 0; i < numBytes; i++) { buf[i + offset] = (byte) ((value & (0xffL << (i * 8))) >> (i * 8)); return buf; |
String | integerToTimeString(Integer num) Take an integer and return a String with 0 in the beginning if the integer is <10 if (num < 10) { return "0" + num; } else { return "" + num; |