Why this InputStreamReader throws an exception : <p>When I compile this code in eclipse ,it throws a NullPointerException,but the code in the book is written in this way.Here is this code.</p>

<pre><code> InputStream in = ClassLoader
            .getSystemResourceAsStream("javagames/filesandres/Test1.txt");
 try {
            InputStreamReader reader =new InputStreamReader(in);
            BufferedReader buf = new BufferedReader(reader);
            String line = null;
            while ((line = buf.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (Exception e) {
            }
        }
    }
</code></pre>
