Java Long Number Convert To fromLong(long key)

Here you can find the source of fromLong(long key)

Description

from Long

License

BSD License

Declaration

public static byte[] fromLong(long key) 

Method Source Code

//package com.java2s;
// BSD License (http://lemurproject.org/galago-license)

public class Main {
    public static byte[] fromLong(long key) {
        byte[] writeBuffer = new byte[8];

        writeBuffer[0] = (byte) (key >>> 56);
        writeBuffer[1] = (byte) (key >>> 48);
        writeBuffer[2] = (byte) (key >>> 40);
        writeBuffer[3] = (byte) (key >>> 32);
        writeBuffer[4] = (byte) (key >>> 24);
        writeBuffer[5] = (byte) (key >>> 16);
        writeBuffer[6] = (byte) (key >>> 8);
        writeBuffer[7] = (byte) (key >>> 0);
        return writeBuffer;
    }/*from   www.  ja  v a  2  s  . c o m*/
}

Related

  1. convertLongToDouble(final long[] longs)
  2. convertLongToInt(long l)
  3. convertLongToString(long value)
  4. fromLong(long d)
  5. fromLong(long input)
  6. fromLong(long longValue)
  7. fromLong(long v, int offset, byte[] dest)
  8. fromLong(Long value)
  9. fromLong(long value)