Here you can find the source of getMagnitude(BigInteger bi)
public static byte[] getMagnitude(BigInteger bi)
//package com.java2s; //License from project: Apache License import java.math.BigInteger; public class Main { public static byte[] getMagnitude(BigInteger bi) { byte[] b = bi.toByteArray(); if ((b.length > 1) && (b[0] == 0)) { int n = b.length - 1; byte[] newarray = new byte[n]; System.arraycopy(b, 1, newarray, 0, n); b = newarray;//from ww w . j ava 2s . c o m } return b; } }