- uri
- The desired URI to open.
- mode
- The file mode to use, as per ContentProvider.OpenFile(Android.Net.Uri, System.String).
Documentation for this section has not yet been entered.
Type Reason Java.IO.FileNotFoundException Throws FileNotFoundException if no file exists under the URI or the mode is invalid.
Open a raw file descriptor to access data under a URI. This is like ContentResolver.OpenAssetFileDescriptor(Android.Net.Uri, System.String), but uses the underlying ContentProvider.OpenFile(Android.Net.Uri, System.String) ContentProvider.openFile()} method, so will not work with providers that return sub-sections of files. If at all possible, you should use ContentResolver.OpenAssetFileDescriptor(Android.Net.Uri, System.String). You will receive a FileNotFoundException exception if the provider returns a sub-section of a file.
See ContentResolver.OpenAssetFileDescriptor(Android.Net.Uri, System.String) for more information on these schemes.
If opening with the exclusive "r" or "w" modes, the returned ParcelFileDescriptor could be a pipe or socket pair to enable streaming of data. Opening with the "rw" mode implies a file on disk that supports seeking. If possible, always use an exclusive mode to give the underlying Android.Content.ContentProvider the most flexibility.
If you are writing a file, and need to communicate an error to the provider, use Android.OS.ParcelFileDescriptor.CloseWithError(string).