I'll admit it, I'm stumped. It's not a double. It's not outside of the range of an integer. It's not NAN. It's not a non-integer in any way shape or form as far as I can tell.
Why would I get that error?
Here's the code that causes it:
String filename = "confA.txt";
//Make a new filereader to read in confA
FileReader fileReader = new FileReader(filename);
//Wrap into a bufferedReader for sanity's sake
BufferedReader bufferedReader = new BufferedReader(fileReader);
//Get the port number that B is listening to
int portNum = Integer.parseInt(bufferedReader.readLine());
It fails on that last line, stating:
java.lang.NumberFormatException: For input string: "5000"
Which is the number I want.
I've also attempted
Integer portNum = Integer.parseInt(bufferedReader.readLine());
But that didn't work either. Neither did valueOf().
Arrays.toString(line.toCharArray())(where line is what you read from the reader). You might have non-printable characters in the string.