Here you can find the source of longArrayToString(int startIndex, long[] chars)
public static String longArrayToString(int startIndex, long[] chars)
//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); } }