I\'m importing a large text file, 17 million digits long and I\'m using this code:
BufferedReader reader = new BufferedReader(new FileReader(\"test2
As an optimization, since BigInteger is Serializable, you could save it to a binary file once and speed up your loading considerably.
Loading a serialized object should be way faster than parsing a huge string everytime.
Use ObjectOutputStream to save your big integer and ObjectInputStream to read it back in.