title: Cannot read APK assets API Level 7 - Getting InputStream IOException
body: <p>I am really stuck with this one.  </p>
  
  <p>I am trying to copy a file from the Assets folder of the apk to a local file. This WORKS in API Level 11, but NOT in API level 7. The tests are run on the emulator. API level 11 and above have also been tested successfully on a device. </p>
  
  <p>UPDATE: I have tested with API Level 10 and it works fine. Therefore this issue is only applicable to API Level 7 (and possibly 8 and 9).</p>
  
  <p>I am doing the following: </p>
  
  <ol>
  <li>Get the <code>AssetManager</code> - OK</li>
  <li>Open the <code>InputStream</code> - OK (no exception but not sure this works well)</li>
  <li>Open the <code>FileOutputStream</code> -OK</li>
  <li>Instantiate a <code>byte[]</code> to read data in (with size 1024) - OK</li>
  <li>Read the data from the asset into the <code>byte[]</code> - IOException is thrown without any details. </li>
  </ol>
  
  <p>Below is the code:</p>
  
  <pre><code>InputStream dbFromApk = null; 
  OutputStream dbout = null;
  
  //1. Get the AssetManager
  AssetManager am = this.getAssets();
  
  //The line below is only a test - see bottom of the post how I used it
  String[] files = am.list("");
  
  //2. Open the InputStream - following this InputStream is no longer null
  dbFromApk = this.getAssets().open(DB_FILENAME, AssetManager.ACCESS_STREAMING);
  
  //3. Create the FileOutputStream
  dbout = new FileOutputStream(dbFile);
  
  //4. Instantiate the buffer to read data into
  byte[] buffer = new byte[1024];
  
  int bytesRead = 0;
  
  //5. Read data - IOException is thrown - No further details in the exception
  bytesRead = dbFromApk.read(buffer);
  </code></pre>
  
  <p>When I put the debugger and inspect the <code>files</code> array, I get an Eclipse error:</p>
  
  <pre><code>'JDI thread evaluations' has encountered a problem. 
  Exception processing async thread queue
  java.lang.UnsupportedOperationException
  </code></pre>
  
  <p>Inspecting the same variable when running at API level 11 works fine.  </p>