Here you can find the source of toBigInteger(final byte[] bytes)
Parameter | Description |
---|---|
bytes | The bytes to convert. |
public static BigInteger toBigInteger(final byte[] bytes)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { /**//w w w . jav a 2 s . c o m * Converts a little endian byte array to a BigInteger. * * @param bytes The bytes to convert. * @return The resulting BigInteger. */ public static BigInteger toBigInteger(final byte[] bytes) { final byte[] bigEndianBytes = new byte[bytes.length + 1]; for (int i = 0; i < bytes.length; ++i) { bigEndianBytes[i + 1] = bytes[bytes.length - i - 1]; } return new BigInteger(bigEndianBytes); } }