Help with filereader

Hello I am using RoboRealm to find the hotzone, and write its x position on a file (variables). I am using the filreader to read the variables to my code(please tell my how to use spoilers) and am getting a mysterious error that only appears sometimes.
package recognitiotion;



  • @author rc10545
    public class getCog_X {

    int] Cog_X = new int[9999];
    //Creates the Cog_X array
    int cogi = 0;
    // controls Cog_X array

    public void cog() throws IOException {

     FileReader fr = new FileReader("c:/cygwin64/home/rc10545/variables");
     char] a = new char[9999999];
     int i;
     //updates text
     String y = new String(a);
     //Converts the char to one big string
     String tokens] = y.split("

//splits the string down on every line break
i = tokens.length;
//Gets a variable for how long the tokens array is

    Integer convert = Integer.valueOf(tokens*);  
    // converts tokens into the convert int
  :( :( :( Error is here between these two lines:( :(
    Cog_X[cogi] = convert;
    // changes the convert variable into an array

    // goes to the next Cog_X array item\
}//method cog

public void positioner(int Cogx) {

int remember = 0;
//remembers wether it hass does the initial movement

    if (remember == 0 &&  Cogx > 320) {
        //goright  for [five] seconds
    } else if (remember == 0) {
        //goleft for [less] seconds
    }//does initial movement to bit right  of the center of hotzone

    if (remember == 2 && Cogx > 300 && Cogx < 330) {

    } else if (remember == 1) {
        //makes sure it does not shoot while moving


}//method positioner

public void runner() throws IOException {
    int Cogx;

//Positioner’s Cog_X[cogi]
while (true) {

        Cogx = Cog_X[cogi];

    }//infinite while loop

}//method main

public static void main(String args]) throws IOException {

    (new getCog_X()).runner();


Exception in thread “main” java.lang.NumberFormatException: For input string: "5
at java.lang.NumberFormatException.forInputString(
at java.lang.Integer.parseInt(
at java.lang.Integer.valueOf(
at recognitiotion.getCog_X.cog(
at recognitiotion.getCog_X.runner(
at recognitiotion.getCog_X.main(
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Integer convert = Integer.valueOf(tokens*); 

What happens when y contains something that isn’t parseable as an integer? For example, you might only read a partial message and end up with a null string for one of the tokens, or is less than 2 tokens long.*