title: java.io.IOException: The handle is invalid
body: <p>I am trying to learn programming on my own time and I am still trying to get the hang of it. I am getting the following error: </p>
  
  <blockquote>
    <p>java.io.IOException: The handle is invalid</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>public class PrimeFinder {
  private int[] prime;
  FileInputStream input = null;
  //default contructor uses the premade file prime.txt that has the first 10000 digits of pi
  public PrimeFinder() throws IOException {
      try{
          input = new FileInputStream ("primes.txt");
      }
      finally {
          if (input != null ) {
              input.close();
          }
      }
  }
  //constructor with a predefined text file to use.
  public PrimeFinder(String txtFile) throws IOException {
      try{
          input = new FileInputStream(txtFile);
      }
      finally {
          if (input != null ) {
              input.close();
          }
      }
  }
  public static void main(String[] args) throws IOException{
  
      PrimeFinder tester  = new PrimeFinder();
      tester.arrayListWithNumbers();
  }
  }
  </code></pre>
  
  <p>I believe I'm getting the error whenever I invoke the <code>arrayListWithNumbers()</code> method, when I attempt to show the number of bytes in the default constructor, then it works perfectly fine and shows a tally of <code>101281 bytes</code>. </p>