Hi i am getting an IOException running my application using Android 2.2. I dont get that when I use Android 2.3.
I am trying to copy a pdf file (size 1.6MB) from assets folder to the internal storage of the application using the following block of code.
1. private void copyFile(InputStream in, OutputStream out) throws IOException {
2. byte[] buffer = new byte[1024];
3. int read;
4. while((read = in.read(buffer)) != -1){
5. out.write(buffer, 0, read);
6. }
7. }
I am getting the IOException when I execute line 4.
It runs without any exception in the following cases - When I use small file (size 320kb) - When I build it as Android 2.3 project.
Any suggestions on how to solve this issue? If size is a problem, is there a work around for that?
Your help will be greatly appreciated.
Thanks, Navin