Java Long Number Convert To convertLongToBytes(long l)

Here you can find the source of convertLongToBytes(long l)

Description

convert Long To Bytes

License

Apache License

Declaration

public static byte[] convertLongToBytes(long l) 

Method Source Code

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

public class Main {
    public static byte[] convertLongToBytes(long l) {
        byte[] b = new byte[8];
        for (int i = 0; i < 8; i++) {
            b[i] = (byte) (l >>> (56 - (i * 8)));
        }//from   w  ww  .  ja  v  a2 s  .  c  o m
        return b;
    }
}

Related

  1. convertLongToBytes(final long unsignedIntIp)
  2. convertLongToCharSmall(long theLong)
  3. convertLongToCidr(long unsignedIntCidr)
  4. convertLongToDouble(final long[] longs)
  5. convertLongToInt(long l)