Java Long to Byte Array longToByteArray(long value, byte[] dest)

Here you can find the source of longToByteArray(long value, byte[] dest)

Description

long To Byte Array

License

Open Source License

Declaration

public static void longToByteArray(long value, byte[] dest) 

Method Source Code

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

public class Main {
    public static void longToByteArray(long value, byte[] dest) {
        int lastIndex = dest.length - 1;
        for (int i = lastIndex; i >= 0; i--) {
            dest[i] = (byte) (value & 0xff);
            value = value >> 8;//from   w  w w .  j  a v a 2  s  .co m
        }
    }
}

Related

  1. longToByteArray(long value)
  2. longToByteArray(long value)
  3. longToByteArray(long value, byte[] buffer, int offset)
  4. longToByteArray(long value, byte[] byteArray)
  5. longToByteArray(long value, byte[] data, int offset)
  6. longToByteArray(long value, int nrOfBytes)
  7. longToByteArray6(long addr)
  8. longToByteArray6(long addr)
  9. longToByteArrayBE(long data)