On Windows Phone 8
I have run in to an issue while reading files from the SD card using ExternalStorageFile.OpenForReadAsync()
, which is the only way to read an SD card located file on Windows Phone.
Investigating further it seems that the Microsoft.Phone.Storage.NativeFileStream
has a bug in it which means Seek and SetFilePointer don't work as they should. More detail is given here.
Does anyone have any suggestions how I can work-around this platform bug?
I thought maybe I could inherit from Microsoft.Phone.Storage.NativeFileStream
and override the buggy methods, but NativeFileStream
doesn't seem to be available and I'm not sure what the correct code should be anyway. Or perhaps I can force this Stream into my own Stream class where I can control these methods?
Perhaps I could pad the file I need to open with garbage at the beginning so I can start my seeks in the "higher 32bits of the long"? The file is specific to my app so it doesn't need to be opened by anything else.
Any ideas for a work-around? A bit of a lower level problem than I'm used to dealing with so keep to hear some ideas.