You could get a String and add one line at a time to it, instead of individual integers.
String str="",output="";
try{
BufferedReader in = new BufferedReader(new FileReader("input.txt"));
while ( (str=in.readLine()) != null){
output+=str;
}
in.close();
}
After this, you could split theoutput string into individual characters (numbers) with the " " separator and put them into your 2d array.
Source: http://www.coderanch.com/t/386279/java/java/string-split-any-delimiter
Pattern p = Pattern.compile(myDelimiter, Pattern.LITERAL) ;
String[] result = p.split(myString);
Or, for maximum simplicity but loss of time, read twice from your file. One time number by number, into your 2d array, second time line by line into the string.