List of utility methods to do Integer Create
int | toInt(byte[] si) Convert a byte[] (most significant byte first) to the corresponding int value. return toInt(si, false);
|
int[] | toInt(byte[] src) Convert an array of byte 's into an array of int '. int number = src.length; int[] dst = new int[number]; for (int j = 0; j < number; ++j) { dst[j] = (int) src[j]; return dst; |
int | toInt(byte[] src) Converts a given byte array to an integer. return readInt(src, 0);
|
int | toInt(byte[] src, int srcPos) to Int int dword = 0; for (int i = 0; i < 4; i++) { dword = (dword << 8) + (src[i + srcPos] & 0xFF); return dword; |
int | toInt(byte[] value) Converte um texto representado por um arranjo de bytes em um inteiro. int limit = value.length - 1; byte signal = value[0] == NEGATIVE ? FALSE : TRUE; byte hasSignal = value[0] == NEGATIVE || value[0] == POSITIVE ? TRUE : FALSE; int start = hasSignal == TRUE ? 1 : 0; int result = 0; int mult = 1; for (int i = limit; i >= start; i--) { int tmp = value[i] - ZERO; ... |
int | toInt(byte[] value) to Int return toInt(value, 0);
|
int | toInt(char msc, char lsc) joining 2 chars to form an int return ((msc << 16) | lsc);
|
int | toInt(char[] bytes, boolean le) to Int if (bytes.length != 8) return 0; return (int) Long.parseLong(bytesToString(bytes, le, true), 16); |
int | toInt(double d) Rounds the double to the nearest integer. if (d > 0) d += 0.5; else if (d < 0) d -= 0.5; return (new Double(d)).intValue(); |
int | toInt(double d) Cast double values into integer. if (d > Integer.MAX_VALUE || d < Integer.MIN_VALUE) { throw new IllegalArgumentException("Value out of int range - " + d); return (int) d; |