Java Utililty Methods Integer Create

List of utility methods to do Integer Create

Description

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

Method

inttoIntHeader(String value)
to Int Header
if (value == null) {
    return -1;
return Integer.parseInt(value);
inttoIntLE(byte[] value)
to Int LE
return ((value[3] & 0xff) << 24) | ((value[2] & 0xff) << 16) | ((value[1] & 0xff) << 8) | (value[0] & 0xff);
Integer[]toIntList(String valus)
to Int List
Integer[] intList = null;
try {
    String[] strList = valus.replace(" ", "").split(",");
    intList = new Integer[strList.length];
    for (int i = 0; i < strList.length; i++) {
        intList[i] = Integer.parseInt(strList[i]);
} catch (Exception e) {
...
int[][]toIntMatrix(Number[][] matrix)
Turns the Number matrix into one consisting of primitive ints.
int[][] result;
int i;
int n;
result = new int[matrix.length][];
for (i = 0; i < matrix.length; i++) {
    result[i] = new int[matrix[i].length];
    for (n = 0; n < matrix[i].length; n++)
        result[i][n] = matrix[i][n].intValue();
...
IntegertoIntOrNull(String string)
tries to parse the value as int or in case of an error returns null
Integer i = null;
try {
    i = Integer.valueOf(string);
} catch (NumberFormatException e) {
return i;
StringtoIntPlusOneString(Object object)
to Int Plus One String
if (object == null) {
    return null;
} else {
    return toIntString(toInt(object) + 1);
int[]toIntRound(double[] a)
to Int Round
int[] b = new int[a.length];
for (int i = 0; i < a.length; i++) {
    b[i] = (int) Math.round(a[i]);
return b;
int[]toInts(byte[] bytes)
to Ints
if (bytes == null) {
    return null;
int[] data = new int[bytes.length];
for (int i = 0; i < bytes.length; i++) {
    data[i] = bytes[i];
return data;
...
int[]toInts(byte[] readBuffer, int o, int l)
to Ints
int[] v = new int[l / 4];
for (int i = 0; i < v.length; i++)
    v[i] = toInt(readBuffer, o + i * 4);
return v;
voidtoInts(byte[] src, int srcOffset, int[] dst, int dstOffset, int length)
to Ints
if (length < 0)
    throw new IllegalArgumentException("length must be >= 0, length = " + length);
for (int i = dstOffset; i < dstOffset + length; i++) {
    dst[i] = getInt(src, srcOffset);
    srcOffset += 4;