Here you can find the source of convertLong2FourBytes(long data)
public static byte[] convertLong2FourBytes(long data)
//package com.java2s; public class Main { public static byte[] convertLong2FourBytes(long data) { byte[] result = new byte[4]; result[3] = ((byte) (0xFF & data)); result[2] = ((byte) ((0xFF00 & data) >> 8)); result[1] = ((byte) ((0xFF0000 & data) >> 16)); result[0] = ((byte) ((0xFF000000 & data) >> 24)); return result; }//from ww w.ja va2 s .c o m }