Here you can find the source of convertLongToBytes(long l)
public static byte[] convertLongToBytes(long l)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] convertLongToBytes(long l) { byte[] b = new byte[8]; for (int i = 0; i < 8; i++) { b[i] = (byte) (l >>> (56 - (i * 8))); }//from w ww . ja v a2 s . c o m return b; } }