How can i copy my database from res/raw to database path

I try

InputStram in = getResources().openRawResource(R.raw.mydata);
OutputStram out = new FileOutputStram("/data/data/mypackage/databases/
mydata/db");

byte[] buff = new byte[1];
int len;
while( (len = in.read(buff)) > 0){
  out.write(buff);
}
out.close();
int.close();

but i got an IOException with no message
I fond some reason about binary and unicode file but i don't know
about it


How can i do

Thank
Jiramot

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to