Here you can find the source of getUnsignedBigInteger(byte[] data, int offset, int length)
Parameter | Description |
---|---|
data | The bytes. |
offset | The first byte. |
length | The amount of bytes to process. |
public static BigInteger getUnsignedBigInteger(byte[] data, int offset, int length)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { /**// www .j ava2s . c o m * Returns a positive BigInteger from the given bytes. (Big endian) * * @param data * The bytes. * @param offset * The first byte. * @param length * The amount of bytes to process. * @return A BigInteger from the given bytes. */ public static BigInteger getUnsignedBigInteger(byte[] data, int offset, int length) { if (length == 0) { return BigInteger.ZERO; } byte[] value = new byte[length + 1]; System.arraycopy(data, offset, value, 1, length); return new BigInteger(value); } }