Java Long Number Array to String longArrayToString(int startIndex, long[] chars)

Here you can find the source of longArrayToString(int startIndex, long[] chars)

Description

long Array To String

License

Open Source License

Declaration

public static String longArrayToString(int startIndex, long[] chars) 

Method Source Code

//package com.java2s;

public class Main {
    private static final long BYTE_MASK = 0xFF;

    public static String longArrayToString(int startIndex, long[] chars) {
        // We use a byte array, so "new String(...)" is able to handle Unicode Characters correctly
        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);
        }//from  w w w.  ja va 2  s  .co m
        return new String(bytes);
    }
}

Related

  1. convertLongArrayToString(Long[] longArray)
  2. convertLongArrayToString(long[] value, String separator)
  3. longArrayAsString(long[] a)
  4. longArrayToString(long[] longs)