Java Utililty Methods Integer Convert To

List of utility methods to do Integer Convert To

Description

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

Method

longconvertInt(byte[] data)
convert Int
return ((data[3] & 0xFF) << 24) | ((data[2] & 0xFF) << 16) | ((data[1] & 0xFF) << 8) | (data[0] & 0xFF);
longconvertInt(byte[] data)
convert Int
return convertInt(data, false);
intconvertInt(String str, int defaults)
convert Int
if (str == null) {
    return defaults;
try {
    return Integer.parseInt(str);
} catch (Exception e) {
    return defaults;
NumberconvertInt(String str, int radix)
convert Int
long x = Long.parseLong(str, radix);
if (x <= (long) Integer.MAX_VALUE && x >= (long) Integer.MIN_VALUE) {
    return new Integer((int) x);
return new Long(x);
intconvertInt(String value)
convert Int
try {
    return Integer.parseInt(value);
} catch (Exception e) {
    return 0;
IntegerconvertInt(String valueAsString)
convert Int
return Integer.valueOf(valueAsString);
int[]convertInt(String[] idArray)
convert Int
int[] desArray = new int[idArray.length];
for (int i = 0; i < desArray.length; i++) {
    desArray[i] = Integer.parseInt(idArray[i]);
return desArray;
byteconvertInt2Byte(int data)
convert Int Byte
return (byte) (0xFF & data);
byte[]convertInt2Bytes(int data)
convert Int Bytes
byte[] bytes = new byte[] { convertInt2Byte(data) };
return bytes;
byte[]convertInt32(int v, boolean isLE)
Convert 32-bits integer value to bytes arrays.
byte[] bytes = new byte[4];
if (isLE) {
    bytes[3] = (byte) ((v >>> 24) & 0xFF);
    bytes[2] = (byte) ((v >>> 16) & 0xFF);
    bytes[1] = (byte) ((v >>> 8) & 0xFF);
    bytes[0] = (byte) ((v >>> 0) & 0xFF);
} else {
    bytes[0] = (byte) ((v >>> 24) & 0xFF);
...