Here you can find the source of Int642Bytes(long sour)
public static byte[] Int642Bytes(long sour)
//package com.java2s; public class Main { public static byte[] Int642Bytes(long sour) { byte dest[] = { (byte) ((sour & 0xFF00000000000000L) >> 56), (byte) ((sour & 0x00FF000000000000L) >> 48), (byte) ((sour & 0x0000FF0000000000L) >> 40), (byte) ((sour & 0x000000FF00000000L) >> 32), (byte) ((sour & 0x00000000FF000000L) >> 24), (byte) ((sour & 0x0000000000FF0000L) >> 16), (byte) ((sour & 0x000000000000FF00L) >> 8), (byte) (sour & 0x00000000000000FF) }; return dest; }//from www .jav a 2 s. co m }