Java Long to Byte Array longToByteArray(long value)

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

Description

long To Byte Array

License

Open Source License

Declaration

static byte[] longToByteArray(long value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    static byte[] longToByteArray(long value) {
        return new byte[] { (byte) value, (byte) (value >> 8), (byte) (value >> 16), (byte) (value >> 24),
                (byte) (value >> 32), (byte) (value >> 40), (byte) (value >> 48), (byte) (value >> 56) };
    }/* w w w.j a v a2s.  c o m*/
}

Related

  1. longToByteArray(long longHi, long longLo, byte[] array, int offset)
  2. longToByteArray(long number)
  3. longToByteArray(long pSrc, byte[] pDst, int pOffset)
  4. longToByteArray(long source)
  5. longToByteArray(long v)
  6. longToByteArray(long value)
  7. longToByteArray(long value)
  8. longToByteArray(long value, byte[] buffer, int offset)
  9. longToByteArray(long value, byte[] byteArray)