title: JSONParser getResourceAsStream
body: <p>I am working in a project and I need a resource in it. I am trying to get it using this code:</p>
  
  <blockquote>
    <p>InputStream is =
    JSONParser.class.getResourceAsStream("a.json");<br>
              String jsonTxt = IOUtils.toString( is );</p>
  </blockquote>
  
  <p>The file a.json is located in the main file of the project.</p>
  
  <p>The exact problem is: </p>
  
  <p>Exception in thread "main" java.lang.NullPointerException<br>
      at java.io.Reader.(Reader.java:61)<br>
      at java.io.InputStreamReader.(InputStreamReader.java:55)<br>
      at org.apache.commons.io.IOUtils.copy(IOUtils.java:1049)<br>
      at org.apache.commons.io.IOUtils.toString(IOUtils.java:359)<br>
      at com.playence.parser.JSon.main(JSon.java:28)  </p>
  
  <p>Debugging, I saw that variable 'is' is null, and I guess that is why NullPointException, bugt I don't know how to solve it.</p>
  
  <p>Any help?</p>
  
  <p>Thans in advance.</p>