List of utility methods to do Integer Create
int[] | toIntArrayUnshifted(byte... arguments) to Int Array Unshifted int[] result = new int[arguments.length]; for (int i = 0; i < result.length; i++) result[i] = (byte) (arguments[i] + 128); return result; |
int | toIntBE(byte[] src, int offset) 32bit to int return (((src[offset] & 0xFF) << 24) + ((src[++offset] & 0xFF) << 16) + ((src[++offset] & 0xFF) << 8)
+ (src[++offset] & 0xFF));
|
int | toIntBigEndian(byte[] input) Convert a byte array of length 4 into an int number, using big-endian notation int result = 0; if (input.length != 4) { return 0; result ^= (input[0] & 0xff) << 24; result ^= (input[1] & 0xff) << 16; result ^= (input[2] & 0xff) << 8; result ^= input[3] & 0xff; ... |
int | toIntDecoded(String s) to Int Decoded return Integer.decode(s);
|
int | toIntDefaultIfNull(Integer configured, int theDefault) to Int Default If Null return configured != null ? configured.intValue() : theDefault;
|
int | toInteger(boolean b) Cast a boolean value to integer. return b ? 1 : 0;
|
int | toInteger(boolean bool) to Integer return bool ? 1 : 0;
|
int | toInteger(boolean bool) Converts a boolean to an int using the convention that BooleanUtils.toInteger(true) = 1 BooleanUtils.toInteger(false) = 0 return bool ? 1 : 0;
|
int | toInteger(boolean bool) Converts a primitive boolean to a primitive integer by assuming 0 is false and everything else (1) is true. return bool ? 1 : 0;
|
int | toInteger(byte b1, byte b2, byte b3, byte b4) Creates an integer from four bytes. return ((b1 & 0xFF) << 24) | ((b2 & 0xFF) << 16) | ((b3 & 0xFF) << 8) | (b4 & 0xFF);
|