I have an Nook Color (Android 2.1) device and the app which is going to read some huge files (PDFs) from sdcard. I'm going to use FileInputStream for file reading (and it works fine both on emulator and on Android 2.2+ devices). Unfortunately it works painfuly slow (about 25 sec for 125Mb file) while executing the following code:
FileInputStream fileInputStream = new FileInputStream(filename);
fileInputStream.skip(offset);
BitmapFactory.Options options = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeStream(fileInputStream, null, options);
fileInputStream.close();
return bitmap;
The file is placed somewhere on sd card. The offset could points to any point at the file (even to the beginning) -- the problem is still in place.
What could be a reason of this performance problem?