public static String getNameFromADNEntry(byte[] input) {
        if ((input[0] & 0xff) == 0x80) {
            return UCS2toUTF16(input);
        }
        if ((input[0] & 0xff) == 0x81) {
            return UCS2toUTF16(input);
        }
        if ((input[0] & 0xff) == 0x82) {
            return UCS2toUTF16(input);
        }

        int i = 0;
        CharsetProvider gsmProvider = new CharsetProvider();
        Charset gsmCharset = gsmProvider.charsetForName("GSM-default-alphabet");
        byte[] actualName;
        while ((input[i] != (byte) 0xff) && (i < 14)) {
            i++; //finds out correct length of name in input record
        }
        actualName = new byte[i];
        System.arraycopy(input, 0, actualName, 0, i);

        return new String(actualName, gsmCharset);
    }