Here you can find the source of longToByteArray(final long v, final byte[] buf, final int offset)
public static final void longToByteArray(final long v, final byte[] buf, final int offset)
//package com.java2s; //License from project: Apache License public class Main { public static final void longToByteArray(final long v, final byte[] buf, final int offset) { buf[offset + 0] = (byte) ((v >> 56) & 0xFF); buf[offset + 1] = (byte) ((v >> 48) & 0xFF); buf[offset + 2] = (byte) ((v >> 40) & 0xFF); buf[offset + 3] = (byte) ((v >> 32) & 0xFF); buf[offset + 4] = (byte) ((v >> 24) & 0xFF); buf[offset + 5] = (byte) ((v >> 16) & 0xFF); buf[offset + 6] = (byte) ((v >> 8) & 0xFF); buf[offset + 7] = (byte) ((v >> 0) & 0xFF); }/*from w w w . j a v a 2 s. c o m*/ }