Here you can find the source of readLineAsBigInteger(BufferedReader br)
Parameter | Description |
---|---|
br | reader of the keyfile |
Parameter | Description |
---|---|
IOException | thrown if something went wrong with readline() |
NumberFormatException | thrown if read line can't be converted to a BigInteger |
public static BigInteger readLineAsBigInteger(BufferedReader br) throws IOException, NumberFormatException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.IOException; import java.math.BigInteger; public class Main { /**//from w ww . j a v a 2 s. c o m * Executes readline with the given buffered reader * Converts the read string to an BigInteger * @param br reader of the keyfile * @return Line as BigInteger * @throws IOException thrown if something went wrong with readline() * @throws NumberFormatException thrown if read line can't be converted to a BigInteger */ public static BigInteger readLineAsBigInteger(BufferedReader br) throws IOException, NumberFormatException { String str = br.readLine(); if (str == null) { throw new IOException(); } return new BigInteger(str); } }