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 the comments have indicated, your code is slow because you're attempting to load a number with a lot of digits.
If you're unsatisfied with the performance of Java's BigInteger
implementation, then I suggest you look elsewhere.
This library claims to have a BigInteger that outperforms Java's implementation (note it may not speed up loading the number, but it should improve multiplication and division performance).