Java Long to String long2String(long x)

Here you can find the source of long2String(long x)

Description

long String

License

Apache License

Declaration

public static String long2String(long x) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String long2String(long x) {
        char[] cArray = long2char(x);
        StringBuilder sbResult = new StringBuilder(cArray.length);
        for (char c : cArray) {
            sbResult.append(c);/*from   w w  w  .j  a va 2 s.  c  om*/
        }
        return sbResult.toString();
    }

    public static char[] long2char(long x) {
        char[] c = new char[4];
        c[0] = (char) (x >> 48);
        c[1] = (char) (x >> 32);
        c[2] = (char) (x >> 16);
        c[3] = (char) (x);
        return c;
    }
}

Related

  1. Long2Str(long i)
  2. long2String(final long ip)
  3. Long2String(final long value)
  4. long2string(long lng, StringBuilder buff)
  5. long2string(long longdata)
  6. long2StringForLen(long num, String str)
  7. long2Word(long val)
  8. LongToStr(long nValue)
  9. longToString(final long value)