Here you can find the source of toBytes(long value)
public static byte[] toBytes(long value)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] toBytes(long value) { return new byte[] { (byte) (value >>> 56), (byte) (value >>> 48), (byte) (value >>> 40), (byte) (value >>> 32), (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value }; }/*from w w w . j av a 2 s . c o m*/ }