title: openRawResource: does compressed files in APK get uncompressed completely?
body: <p>I have a custom file format in res/raw, which means it will get compressed in APK.</p>
  
  <p>Assume my application is installed on the device. When I open a file via <code>openRawResource()</code>, does it completely uncompress the file in the memory?</p>
  
  <p>E.g. if it's a 3MB file, will it uncompress it in memory? If I only need 10KB data from a certain offset (and I reach it via <code>BufferedInputStream.skip()</code>), will it still consume 3MB when <code>openRawResource()</code> is called? </p>
  
  <p><strong>UPDATE</strong>: unless I'm overlooking something, it does not seem to be uncompressing the whole file. Consider the following test.</p>
  
  <p>I added a 30MB file of random data to res/raw. Its extension is not ogg,mp3,png or similar, so it will be compressed in the APK. In the below code, I seek to around the 19MB-th position, and read cca. 117KB from the file. And it worked, even though the uncompressed length is 30MB. (As far as I read, the 1MB limit applies only to assets, not to raw resources.)</p>
  
  <pre><code>is = context.getResources().openRawResource(R.raw.test); // test is a 30MB test.txt
  DataInputStream dis = new DataInputStream(new BufferedInputStream(is, 8192));
  
  
  dis.skip(19555125);
  byte[] testArr = new byte[117412];
  dis.readFully(testArr);
  for (int i = 0; i &lt; testArr.length - 117000; i++) {
      Log.w("LOG_TAG", "" + testArr[i]);
  }
  </code></pre>