Java Long to Byte Array LongToBytesLE(final long val)

Here you can find the source of LongToBytesLE(final long val)

Description

Long To Bytes LE

License

Creative Commons License

Declaration

public final static byte[] LongToBytesLE(final long val) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public final static byte[] LongToBytesLE(final long val) {
        byte[] buf = new byte[8];

        for (int i = 0; i < 8; i++) {
            buf[i] = (byte) (val >>> (8 * i));
        }//from  ww  w. ja v  a2 s.c  o  m

        return buf;
    }
}

Related

  1. longToBytes(long value, byte[] array, int offset)
  2. longToBytes(long value, byte[] buffer, int bufferStartPosition)
  3. longToBytes(long value, byte[] buffer, int offset)
  4. LongToBytes4(long l, byte abyte0[])
  5. LongToBytes8(long l)
  6. longToBytesLE(long value, byte[] buffer)
  7. longToBytesLE(long value, byte[] buffer, int offset, int length)
  8. longToBytesPlus8(byte[] p, long v)