Here you can find the source of readBigInteger(int n, DataInput dis)
public static BigInteger readBigInteger(int n, DataInput dis) throws IOException
//package com.java2s; import java.io.DataInput; import java.io.IOException; import java.math.BigInteger; public class Main { public static BigInteger readBigInteger(int n, DataInput dis) throws IOException { BigInteger ret = BigInteger.ZERO; byte[] temp = new byte[n]; dis.readFully(temp, 0, n);/*www . jav a2 s. c o m*/ for (int j = n - 1; j >= 0; j--) { ret = ret.or(BigInteger.valueOf(0xFF & temp[j])); ret = ret.shiftLeft(8); } ret = ret.shiftRight(8); return ret; } public static BigInteger readBigInteger(DataInput ois) throws IOException { int length = ois.readInt(); byte[] bytes = new byte[length]; ois.readFully(bytes, 0, length); return new BigInteger(bytes); } }