Android Long to Byte Array Convert longToByteArray(long a)

Here you can find the source of longToByteArray(long a)

Description

long To Byte Array

Declaration

public static byte[] longToByteArray(long a) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] longToByteArray(long a) {
        byte[] bArray = new byte[8];
        for (int i = 0; i < bArray.length; i++) {
            bArray[i] = new Long(a & 0XFF).byteValue();
            a >>= 8;/*w  w w  .j ava2  s .  c  om*/
        }
        return bArray;
    }
}

Related

  1. long2bytesBE(long val, byte[] b, int off)
  2. long2bytesLE(long val, byte[] b, int off)
  3. longFitsIn(final long value)
  4. longToByteArray(long l)
  5. longToByteArray(long value)
  6. longToBytes(long l)
  7. longToBytes(long x)