Android Long to Byte Array Convert longToByteArray(long value)

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

Description

long To Byte Array

Declaration

public static final byte[] longToByteArray(long value) 

Method Source Code

//package com.java2s;

public class Main {
    public static final byte[] longToByteArray(long value) {
        return new byte[] { (byte) (value >>> 56), (byte) (value >>> 48),
                (byte) (value >>> 40), (byte) (value >>> 32),
                (byte) (value >>> 24), (byte) (value >>> 16),
                (byte) (value >>> 8), (byte) value };
    }// w w w  .  ja v a 2s  .  co m
}

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 a)
  5. longToByteArray(long l)
  6. longToBytes(long l)
  7. longToBytes(long x)
  8. longs2bytesBE(long[] val)
  9. longs2bytesLE(long[] val)