title: How to read text from an inputstream, formatted as XML, with a BufferedReader.readLine() method?
body: <p>I have an xml file which I included as a resource in my netbeans project.</p>
  
  <p>Now, I try to read it line by line with an inputstream reader:</p>
  
  <pre><code>static InputStream nudeMap = Main.class.getResourceAsStream("overlay_map_2007.txt");
  
  static BufferedReader br = new BufferedReader(new InputStreamReader(nudeMap,"UTF-8"));
  </code></pre>
  
  <p>=> this get met the error:</p>
  
  <pre><code>Exception in thread "Thread-4" java.lang.NullPointerException
      at java.io.Reader.&lt;init&gt;(Reader.java:61)
      at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:80)
  </code></pre>
  
  <p>I checked the encoding of the file and it is indeed UTF-8, so I don't think it is an encoding problem. I have no experience here, but I suspect it might come from the fact that the file is actually xml formatted. First lines are:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;gexf xmlns:viz="http:///www.gexf.net/1.1draft/viz" version="1.1" xmlns="http://www.gexf.net/1.1draft"&gt;
  </code></pre>
  
  <p>My point is, I don't want to write a parser for the use I have of the file. Do you have any clue about how I could read it as a plain old text file, without errors? Thx!</p>
  
  <p>[EDIT]: to make clear: I want to read this file with br.readLine(); not with a Java Parser!</p>