Here you can find the source of longToByte(byte[] buf, int off, long value)
public static void longToByte(byte[] buf, int off, long value)
//package com.java2s; //License from project: Open Source License public class Main { public static void longToByte(byte[] buf, int off, long value) { buf[off + 0] = (byte) (value >>> 56); buf[off + 1] = (byte) (value >>> 48); buf[off + 2] = (byte) (value >>> 40); buf[off + 3] = (byte) (value >>> 32); buf[off + 4] = (byte) (value >>> 24); buf[off + 5] = (byte) (value >>> 16); buf[off + 6] = (byte) (value >>> 8); buf[off + 7] = (byte) (value >>> 0); }/*from w ww . ja v a 2s . c om*/ }