Question: Im getting an input stream, which is an mp3 in my raw folder, and then I am trying to write it back to the raw folder (I know this sounds stupid but I want to do it), but I get an error - file not found, myFile.mp3. Any ideas where I am going wrong?

```
try
        {
          File f=new File("android.resource//com.apps/raw/myFile.mp3");
          InputStream myRawResource = context.getActivity().getResources().openRawResource(mp3ID); 
          OutputStream out=new FileOutputStream(f);
          byte buf[]=new byte[1024];
          int len;
          while((len=myRawResource.read(buf))>0)
          out.write(buf,0,len);
          out.close();
          myRawResource.close();
    }
          catch (IOException e){    
              //error
              }

```

Answer: 
You can't write the raw and assets folder in android.

**Edit:**

[Android documentation](http://developer.android.com/guide/topics/data/data-storage.html#filesInternal)

I copied the key phrase (Tip from the documentation):
If you want to save a static file in your application at compile time, save the file in your project res/raw/ directory. You can open it with openRawResource(), passing the R.raw. resource ID. This method returns an InputStream that you can use to read the file (but you cannot write to the original file).
This can't be done because resources, at runtime, are read-only, are stored in the APK, and would need to be compiled for inclusion in R at compile time.