Java Long to longToCharArray(long seat, int length)

Here you can find the source of longToCharArray(long seat, int length)

Description

long To Char Array

License

Apache License

Declaration

public static char[] longToCharArray(long seat, int length) 

Method Source Code

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

public class Main {
    /**/*from www. j  av  a 2s  .c o  m*/
     * 
    * change from long to char array
    * @param seat
    * @param length
    * @return char[]:  
    * @throws
     */
    public static char[] longToCharArray(long seat, int length) {
        String seatString = Long.toBinaryString(seat);
        int longLength = seatString.length();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length - longLength; i++) {
            sb.append('0');
        }
        sb.append(seatString);
        return sb.toString().toCharArray();
    }
}

Related

  1. longtobinarystring(long wert, int bits)
  2. longToBinaryStringUnsigned(long value)
  3. longToBucket(long key, int buckets)
  4. LongToBuf4(long val, byte[] buf, int offset)
  5. longToBuffer(long l, byte[] ioBuffer)
  6. longToCharBounds(long value)
  7. longToCompare(Long value)
  8. longToDB(long val)
  9. longToEightBytes(final long value)