Here you can find the source of longToByte(long i_Value)
public static byte[] longToByte(long i_Value)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] longToByte(long i_Value) { byte[] v_Ret = new byte[8]; v_Ret[0] = (byte) ((i_Value >>> 56) & 0xFF); v_Ret[1] = (byte) ((i_Value >>> 48) & 0xFF); v_Ret[2] = (byte) ((i_Value >>> 40) & 0xFF); v_Ret[3] = (byte) ((i_Value >>> 32) & 0xFF); v_Ret[4] = (byte) ((i_Value >>> 24) & 0xFF); v_Ret[5] = (byte) ((i_Value >>> 16) & 0xFF); v_Ret[6] = (byte) ((i_Value >>> 8) & 0xFF); v_Ret[7] = (byte) ((i_Value >>> 0) & 0xFF); return v_Ret; }// w w w .j ava 2s. c o m }