Java Utililty Methods Long to Byte Array

List of utility methods to do Long to Byte Array

Description

The list of methods to do Long to Byte Array are organized into topic(s).

Method

voidlongToBytesLE(long value, byte[] buffer)
long To Bytes LE
longToBytesLE(value, buffer, 0, buffer.length);
voidlongToBytesLE(long value, byte[] buffer, int offset, int length)
Converts a long to a little-endian sequence of bytes of the specified length.
int endOffset = offset + length;
for (int i = offset; i < endOffset; ++i) {
    buffer[i] = (byte) value;
    value >>>= 8;
voidlongToBytesPlus8(byte[] p, long v)
long To Bytes Plus
p[8] = (byte) v;
p[9] = (byte) (v >>> 8);
p[10] = (byte) (v >>> 16);
p[11] = (byte) (v >>> 24);
p[12] = (byte) (v >>> 32);
p[13] = (byte) (v >>> 40);
p[14] = (byte) (v >>> 48);
p[15] = (byte) (v >>> 56);
...