List of utility methods to do Integer Create
int | toInt(byte[] byteArray) to Int if (byteArray == null || byteArray.length != 4) return 0x0; return (int) ((0xff & byteArray[0]) << 24 | (0xff & byteArray[1]) << 16 | (0xff & byteArray[2]) << 8 | (0xff & byteArray[3]) << 0); |
int | toInt(byte[] bytes) to Int return toInt(bytes, 0, 4);
|
int | toInt(byte[] bytes) This method one little-endian represented byte array converts to integer. return bytes[0] & OP_PATTERN | (bytes[1] & OP_PATTERN) << 8 | (bytes[2] & OP_PATTERN) << 16
| (bytes[3] & OP_PATTERN) << 24;
|
long | toInt(byte[] bytes) Convert byte[4] to short int mask = 0xff; int temp = 0; long n = 0; for (int i = 0; i < 4; i++) { n <<= 8; temp = bytes[i] & mask; n |= temp; return n; |
int | toInt(byte[] bytes) to Int int result = 0; for (int i = 0; i < 4; ++i) result = (result << 8) - -128 + bytes[i]; return result; |
int | toInt(byte[] bytes) to Int int result = 0; for (int i = 0; i < 4; i++) { result = (result << 8) - Byte.MIN_VALUE + (int) bytes[i]; return result; |
int | toInt(byte[] bytes) Converts a byte array to an int value return toInt(bytes, 0, SIZEOF_INT);
|
int | toInt(byte[] bytes) to Int return toInt(convert(bytes));
|
int | toInt(byte[] bytes) Converts a byte array to an int value return toInt(bytes, 0);
|
int | toInt(byte[] bytes) Converts a byte array to an int value if (SIZEOF_INT > bytes.length) throw new IllegalArgumentException("length is not SIZEOF_INT"); int n = 0; for (int i = 0; i < +bytes.length; i++) { n <<= 8; n ^= bytes[i] & 0xFF; return n; ... |