title: jcodec Permission Denied for NIOUtils.readableFileChannel
body: <p>I'm trying to use JCodec to get all the frames from an MP4 on my emulator.  I have the following permissions in my manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>The file through my adb shell looks like this:</p>
  
  <pre><code>root@generic_x86_64:/sdcard/Download # pwd
  /sdcard/Download
  root@generic_x86_64:/sdcard/Download # ls -la
  -rwxrwx--x root     sdcard_rw 19967250 2015-10-12 16:39 Hummingbird.MP4
  </code></pre>
  
  <p>I've tried doing a chmod 777 Hummingbird.MP4, but that doesn't change the last set of permissions for some reason?  </p>
  
  <p>The following code produces the exception below.</p>
  
  <pre><code>String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
  String fn = baseDir + "/Download/Hummingbird.MP4";
  // test dir to make sure I'm in right place
  String dir = baseDir + "/Download";
  File fDir = new File(dir);
  Log.i("TAG", "fDir.isDir()=" + fDir.isDirectory()); // this is true
  fileMp4 = new File(fn);
  try {
     ch = NIOUtils.readableFileChannel(fileMp4); // line 220 in trace below
  } catch (FileNotFoundException e) {
     e.printStackTrace();
  }
  </code></pre>
  
  <p>I also did a fileMp4.exists() which returns true.</p>
  
  <p>Exception</p>
  
  <pre><code>10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err: java.io.FileNotFoundException: /storage/1F1A-300C/Download/Hummingbird.MP4: open failed: EACCES (Permission denied)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:452)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:76)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at org.jcodec.common.NIOUtils.readableFileChannel(NIOUtils.java:336)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at medloh.com.mp4frames.MainActivity.onActivityResult(MainActivity.java:220)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.Activity.dispatchActivityResult(Activity.java:6428)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.ActivityThread.-wrap16(ActivityThread.java)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.os.Looper.loop(Looper.java:148)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at libcore.io.Posix.open(Native Method)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:438)
  10-14 23:32:27.090 4595-4595/medloh.com.mp4frames W/System.err:     ... 14 more
  </code></pre>
  
  <p>See any problems with this code/configuration?</p>