Here you can find the source of concat(BigInteger left, BigInteger right)
private static BigInteger concat(BigInteger left, BigInteger right)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { private static BigInteger concat(BigInteger left, BigInteger right) { return concat(left, right, right.bitLength()); }//from ww w . java 2s .c om private static BigInteger concat(BigInteger left, BigInteger right, int rightBitLength) { if (right.bitLength() > rightBitLength) { throw new IllegalArgumentException("right side has " + right.bitLength() + " bits. Cannot be extended to " + rightBitLength + " bits"); } return left.shiftLeft(rightBitLength).add(right); } }