ContentResolver.OpenAssetFileDescriptor Method

Definition

Overloads

OpenAssetFileDescriptor(Uri, String)

Open a raw file descriptor to access data under a URI.

OpenAssetFileDescriptor(Uri, String, CancellationSignal)

Open a raw file descriptor to access data under a URI.

OpenAssetFileDescriptor(Uri, String)

Open a raw file descriptor to access data under a URI.

[Android.Runtime.Register("openAssetFileDescriptor", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;", "", ApiSince=3)]
public Android.Content.Res.AssetFileDescriptor OpenAssetFileDescriptor (Android.Net.Uri uri, string mode);
member this.OpenAssetFileDescriptor : Android.Net.Uri * string -> Android.Content.Res.AssetFileDescriptor

Parameters

uri
Uri

The desired URI to open.

mode
String

The file mode to use, as per OpenAssetFile(Uri, String).

Returns

AssetFileDescriptor
Attributes

Exceptions

Throws FileNotFoundException of no file exists under the URI or the mode is invalid.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OpenAssetFileDescriptor(Uri, String, CancellationSignal)

Open a raw file descriptor to access data under a URI.

[Android.Runtime.Register("openAssetFileDescriptor", "(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/content/res/AssetFileDescriptor;", "", ApiSince=19)]
public Android.Content.Res.AssetFileDescriptor OpenAssetFileDescriptor (Android.Net.Uri uri, string mode, Android.OS.CancellationSignal cancellationSignal);
member this.OpenAssetFileDescriptor : Android.Net.Uri * string * Android.OS.CancellationSignal -> Android.Content.Res.AssetFileDescriptor

Parameters

uri
Uri

The desired URI to open.

mode
String

The file mode to use, as per OpenAssetFile(Uri, String).

cancellationSignal
CancellationSignal

A signal to cancel the operation in progress, or null if none. If the operation is canceled, then OperationCanceledException will be thrown.

Returns

AssetFileDescriptor
Attributes

Exceptions

Throws FileNotFoundException of no file exists under the URI or the mode is invalid.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to