Here you can find the source of toBytes(long input)
private static byte[] toBytes(long input)
//package com.java2s; //License from project: Apache License public class Main { private static byte[] toBytes(long input) { byte[] output = new byte[4]; for (int i = 0; i < output.length; i++) { output[i] = (byte) ((input >>> (i * 8)) & 0xff);//big-endian }/*from w ww . j a v a 2s.c o m*/ return output; } }