Java Utililty Methods Long Number Array to String

List of utility methods to do Long Number Array to String

Description

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

Method

StringconvertLongArrayToString(Long[] longArray)
Method to create the comma separated String for the array of Long Values
String csvString = "";
if (longArray != null && (longArray.length) > 0) {
    for (int i = 0; i < longArray.length; i++) {
        if (longArray[i] == null || longArray[i] == 0) {
            csvString += (i) + COMMA_SEPARATOR;
if (csvString.length() > 0) {
    return csvString;
} else {
    return BLANK_STRING;
StringconvertLongArrayToString(long[] value, String separator)
convert Long Array To String
if (value.length == 0) {
    return "";
StringBuilder sb = new StringBuilder();
for (long v : value) {
    sb.append(v);
    sb.append(separator);
sb.setLength(sb.length() - separator.length());
return sb.toString();
StringlongArrayAsString(long[] a)
long Array As String
if (null == a)
    return null;
int len = a.length;
StringBuffer pcs = new StringBuffer(0 < len ? "[" + a[0] : "[");
for (int i = 1; i < len; i++)
    pcs.append(", " + a[i]);
pcs.append(']');
return pcs.toString();
...
StringlongArrayToString(int startIndex, long[] chars)
long Array To String
final byte[] bytes = new byte[chars.length - startIndex];
for (int from = startIndex, to = 0; to < bytes.length; from++, to++) {
    bytes[to] = (byte) (chars[from] & BYTE_MASK);
return new String(bytes);
StringlongArrayToString(long[] longs)
long Array To String
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < longs.length; i++) {
    buffer.append(longs[i]).append(" ");
return buffer.toString();