Here you can find the source of long2byte(long ival, byte b[], int offset)
public static void long2byte(long ival, byte b[], int offset)
//package com.java2s; public class Main { /** *///from w w w. j a v a2 s . c o m public static void long2byte(long ival, byte b[], int offset) { int bits = 64; for (int i = 0; i < 8; i++) { bits -= 8; b[offset + i] = (byte) ((ival >> bits) & 0xff); } } }