Java Long to Byte Array long2bytes(long num)

Here you can find the source of long2bytes(long num)

Description

longbytes

License

Apache License

Declaration

public static byte[] long2bytes(long num) 

Method Source Code

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

public class Main {

    public static byte[] long2bytes(long num) {
        byte[] b = new byte[8];
        for (int i = 0; i < 8; i++) {
            b[i] = (byte) (num >>> 56 - i * 8);
        }//  w w w .j  ava  2 s. c o m
        return b;
    }
}

Related

  1. long2bytes(long i, int byteCount)
  2. long2bytes(long i, int byteCount)
  3. long2bytes(long l, byte[] data, int offset)
  4. long2Bytes(long l, byte[] target, int offset)
  5. long2bytes(long longValue)
  6. long2Bytes(long num)
  7. long2Bytes(long num)
  8. long2bytes(long v)
  9. long2bytes(long v, int len)