Here you can find the source of encode_long(BigInteger big)
public static byte[] encode_long(BigInteger big)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { /**//from w w w .j av a 2 s . co m * encode an arbitrary long number into a byte array (little endian). */ public static byte[] encode_long(BigInteger big) { byte[] data = big.toByteArray(); // reverse the byte array because pickle uses little endian byte[] data2 = new byte[data.length]; for (int i = 0; i < data.length; ++i) data2[data.length - i - 1] = data[i]; return data2; } }