File f=new File("*.txt")//为你的文件名
while((String a=f.readLine())!=null)//以行为单位取字符串
然后以空格作为分隔符将字符串分开
最后进行转换Integer.parseInt(String);