我正在尝试使用以下算法求解 Euler #8。问题是,每当我修改我有巨大注释的行时,错误Unhandled Exception Type IOException
出现在我用注释标记的每一行上//###
。
private static void euler8()
{
int c =0;
int b;
ArrayList<Integer> bar = new ArrayList<Integer>(0);
File infile = new File("euler8.txt");
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream(infile), //###
Charset.forName("UTF-8")));
while((c = reader.read()) != -1) { //###
char character = (char) c;
b = (int)character;
bar.add(b); /*When I add this line*/
}
reader.close(); //###
}