Android Long to Byte Array Convert ulong2bytes(long value)

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

Description

ulongbytes

Declaration

public static byte[] ulong2bytes(long value) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] ulong2bytes(long value) {
        byte[] resultByte = { (byte) ((value >>> 24) & 0xFFFFFFFF),
                (byte) ((value >>> 16) & 0x00FFFFFF),
                (byte) ((value >>> 8) & 0x0000FFFF),
                (byte) (value & 0x000000FF) };

        return resultByte;
    }/*w w w.j  a v a2s .c o m*/
}

Related

  1. long2byteArray(final long number, final int length, final boolean swapHalfWord)
  2. long2bytes(long val)
  3. convertToByteArray(long l)
  4. long2bytes(long num)
  5. toBytes(long longValue)
  6. longToBytes(long data, int n)