title: Unhandled Exception Type IOException
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2305966/why-do-i-get-the-unhandled-exception-type-ioexception">Why do I get the “Unhandled exception type IOException”?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to solve Euler #8 using the following algorithm. Problem is, whenver I modify the line I have the giant comment on, the error <code>Unhandled Exception Type IOException</code> appears on each line that I've marked with the comment <code>//###</code>.</p>
  
  <pre><code>private static void euler8()
  {   
      int c =0;
      int b;
      ArrayList&lt;Integer&gt; bar = new ArrayList&lt;Integer&gt;(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(); //###
  }
  </code></pre>