Java Utililty Methods Long Number Array Convert

List of utility methods to do Long Number Array Convert

Description

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

Method

StringlongArray2Json(long[] array)
long Array Json
if (array.length == 0)
    return "[]";
StringBuilder sb = new StringBuilder(array.length << 4);
sb.append('[');
for (long o : array) {
    sb.append(Long.toString(o));
    sb.append(',');
sb.setCharAt(sb.length() - 1, ']');
return sb.toString();
byte[]longArrayToBytes(long[] d)
long Array To Bytes
byte[] r = new byte[d.length * 8];
for (int i = 0; i < d.length; i++) {
    byte[] s = longToBytes(d[i]);
    for (int j = 0; j < 8; j++)
        r[8 * i + j] = s[j];
return r;
int[]longArrayToIntArray(long[] longs)
long Array To Int Array
int[] ret = new int[longs.length * 2];
for (int i = 0; i < longs.length; i++) {
    ret[i] = (int) (longs[i] >>> 32);
    ret[i + 1] = (int) longs[i];
return ret;