3

I'm trying to read from internal storage (a file) however i'm having issues.

I get a FileInputStream for a file using FileInputStream fis = context.openFileInput(filename). The call is successful, nothing fails. Next I try to create an ObjectInputStream object using the following line: ObjectInputStream ois = new ObjectInputStream(fis).

This throws an IOException EVERY time!! What am I doing wrong?

I've tried using fis as a FileInputStream and as an InputStream object. I'm able to write to a file using ObjectOutputStream.

Sababado
  • 2,524
  • 5
  • 33
  • 51
  • be more specific about your exception. if permission denied then you've probably forgotten to set your storage permissions in the manifest file. – Sergey Benner Feb 18 '12 at 02:09
  • I don't see anything about a permissions issue, though because I'm not ruling that out which permissions should I use to read/write to internal storage? Not an SQLite Db, but a file. – Sababado Feb 18 '12 at 02:19
  • try: http://stackoverflow.com/questions/16994291/ioexception-in-objectinputstream-in-java – Matthew May 11 '15 at 20:36

0 Answers0