Take the 2-minute tour ×

I've been using bundles to pass my information around my application and occasionally save them to a file by first passing them to a parcel.

For some reason occasionally when I try to put them back into a bundle it springs a "readBundle: bad magic number" error on me generated by the following code:

FileInputStream fis = myContext.openFileInput(name);

    byte[] buff = new byte[2048];
    int length = fis.read(buff,0,2048);

    Parcel p = Parcel.obtain();
    p.unmarshall(buff, 0, length);
    return p.readBundle();
share|improve this question
Maybe this is what you are looking for: remotedroid.net/blog/2010/10/13/… –  Robert Massaioli Apr 14 '11 at 1:35
Yah same error but I think our causes were different. Turns out that someone saved another (nonbundle) file to this area and looping over the filelist causes some issues. I probably should have noticed this sooner but I didnt think of it until I saw the sizes of the "parcels" I was reading in. –  isep Apr 14 '11 at 16:21

Your Answer



Browse other questions tagged or ask your own question.