Here you can find the source of longToByteArrayForAS(long i)
public static byte[] longToByteArrayForAS(long i)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] longToByteArrayForAS(long i) { int h = (int) (i / 100000000); int l = (int) (i % 100000000); byte[] result = new byte[8]; result[0] = (byte) ((h >> 24) & 0xFF); result[1] = (byte) ((h >> 16) & 0xFF); result[2] = (byte) ((h >> 8) & 0xFF); result[3] = (byte) (h & 0xFF); result[4] = (byte) ((l >> 24) & 0xFF); result[5] = (byte) ((l >> 16) & 0xFF); result[6] = (byte) ((l >> 8) & 0xFF); result[7] = (byte) (l & 0xFF); return result; }/* ww w. j a va 2 s . c om*/ }