title: FileInputStream for a raw file
body: <p>I have a raw file in <code>res/raw</code> named "<code>pack.dat</code>".</p>
  
  <p>I can open an <code>InputStream</code> with the following code:</p>
  
  <pre><code>    InputStream fis = null;
      try {
          fis = context.getResources().openRawResource(R.raw.pack);
          BufferedReader br = new BufferedReader(new InputStreamReader(fis));
          String nextLine;
          int i = 0, j = 0;
          while ((nextLine = br.readLine()) != null) {
              if (j == 5) {
                  j = 0;
                  i++;
              }
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>This is working, I can read from that file.</p>
  
  <p>But unfortunately I need a <code>FileInputStream</code>. When I do this:</p>
  
  <pre><code>    FileInputStream fs = null;
      Uri url = Uri.parse("android.resource://" + 
                       context.getPackageName() + "/" + R.raw.pack);
      File file = new File(url.toString());
      try {
          fs = new FileInputStream(file);
          fs.getChannel().position(0);
          fs.read(bDatensatz, 0, indexlaenge);
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I get a "<code>file not found</code>" at </p>
  
  <pre><code>fs = new FileInputStream(file);
  </code></pre>
  
  <p><code>context.getResources().openRawResource(R.raw.pack)</code> in the first example returns an <code>InputStream</code>. </p>
  
  <p>What can I use to get a <code>FileInputStream</code> instead?</p>