Java Utililty Methods Long Number Array Create

List of utility methods to do Long Number Array Create

Description

The list of methods to do Long Number Array Create are organized into topic(s).

Method

Long[]longArray(int len)
long Array
return new Long[len];
Long[]LongArrayFrom(long[] array)
Answer a Long array from the supplied array of longs
if (array == null) {
    return new Long[0];
Long[] result = new Long[array.length];
for (int i = 0; i < array.length; i++) {
    result[i] = array[i];
return result;
...
Long[]LongArrayFrom(long[] array)
Long Array From
if (array == null) {
    return new Long[0];
Long[] result = new Long[array.length];
for (int i = 0; i < array.length; i++) {
    result[i] = array[i];
return result;
...
long[]toLongA(byte[] data)
to Long A
if (data == null || data.length % 8 != 0)
    return null;
long[] lngs = new long[data.length / 8];
for (int i = 0; i < lngs.length; i++) {
    lngs[i] = toLong(new byte[] { data[(i * 8)], data[(i * 8) + 1], data[(i * 8) + 2], data[(i * 8) + 3],
            data[(i * 8) + 4], data[(i * 8) + 5], data[(i * 8) + 6], data[(i * 8) + 7], });
return lngs;
...
long[]toLongArray(boolean[] array)
Coverts given booleans array to array of longs.
long[] result = new long[array.length];
for (int i = 0; i < array.length; i++) {
    result[i] = array[i] ? 1 : 0;
return result;
long[]toLongArray(byte[] array)
to Long Array
long[] result = new long[array.length / 8];
for (int i = 0; i < result.length; i++) {
    result[i] = toLong(array, i * 8);
return result;
long[]toLongArray(byte[] byteArray)
Convert an array of bytes into an array of longs.
return getLongArray(byteArray, 0, byteArray.length / 8);
long[]toLongArray(byte[] byteArray)
to Long Array
if (byteArray == null || byteArray.length % 8 != 0)
    return null;
long[] lngs = new long[byteArray.length / 8];
for (int i = 0; i < lngs.length; i++) {
    lngs[i] = toLong(new byte[] { byteArray[(i * 8)], byteArray[(i * 8) + 1], byteArray[(i * 8) + 2],
            byteArray[(i * 8) + 3], byteArray[(i * 8) + 4], byteArray[(i * 8) + 5], byteArray[(i * 8) + 6],
            byteArray[(i * 8) + 7], });
return lngs;
long[]toLongArray(byte[] data)
to Long Array
if ((data == null) || (data.length % 8 != 0)) {
    return null;
long[] lngs = new long[data.length / 8];
for (int i = 0; i < lngs.length; i++) {
    lngs[i] = toLong(new byte[] { data[(i * 8)], data[(i * 8) + 1], data[(i * 8) + 2], data[(i * 8) + 3],
            data[(i * 8) + 4], data[(i * 8) + 5], data[(i * 8) + 6], data[(i * 8) + 7], });
return lngs;
long[][]toLongArray(double[][] array)
to Long Array
int nr = array.length;
int nc = array[0].length;
long[][] ret = new long[nr][nc];
for (int i = 0; i < nr; i++) {
    for (int j = 0; j < nc; j++) {
        ret[i][j] = (long) array[i][j];
return ret;