public static BigInteger extractParameter(final Bytes input, final int offset, final int length) {
    if (offset >= input.size() || length == 0) {
      return BigInteger.ZERO;
    } else if (offset + length < input.size()) {
      return new BigInteger(1, input.slice(offset, length).toArray());
    } else {
      byte[] raw = new byte[length];
      Bytes partial = input.slice(offset);
      System.arraycopy(partial.toArray(), 0, raw, 0, partial.size());
      return new BigInteger(1, raw);
    }
  }
Extract parameter.

@param input the input
@param offset the offset
@param length the length
@return the big integer
evm/src/main/java/org/hyperledger/besu/evm/precompile/BigIntegerModularExponentiationPrecompiledContract.java