Java Long to Byte Array longToBytesLE(long value, byte[] buffer)

Here you can find the source of longToBytesLE(long value, byte[] buffer)

Description

long To Bytes LE

License

Open Source License

Declaration

public static void longToBytesLE(long value, byte[] buffer) 

Method Source Code

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

public class Main {
    public static void longToBytesLE(long value, byte[] buffer) {
        longToBytesLE(value, buffer, 0, buffer.length);
    }/*from w ww  . j  a va  2s . c  o  m*/

    public static void longToBytesLE(long value, byte[] buffer, int offset, int length) {
        int endOffset = offset + length;
        for (int i = offset; i < endOffset; ++i) {
            buffer[i] = (byte) value;
            value >>>= 8;
        }
    }
}

Related

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