ContentResolver.OpenOutputStream Method

Definition

Overloads

OpenOutputStream(Uri)

Synonym for #openOutputStream(Uri, String) openOutputStream(uri, "w").

OpenOutputStream(Uri, String)

Open a stream on to the content associated with a content URI.

OpenOutputStream(Uri)

Synonym for #openOutputStream(Uri, String) openOutputStream(uri, "w").

[Android.Runtime.Register("openOutputStream", "(Landroid/net/Uri;)Ljava/io/OutputStream;", "")]
public System.IO.Stream? OpenOutputStream (Android.Net.Uri uri);
[<Android.Runtime.Register("openOutputStream", "(Landroid/net/Uri;)Ljava/io/OutputStream;", "")>]
member this.OpenOutputStream : Android.Net.Uri -> System.IO.Stream

Parameters

uri
Uri

The desired URI.

Returns

an OutputStream or null if the provider recently crashed.

Attributes

Exceptions

if the provided URI could not be opened.

Remarks

Synonym for #openOutputStream(Uri, String) openOutputStream(uri, "w"). Please note the implementation of "w" is up to each Provider implementation and it may or may not truncate.

Java documentation for android.content.ContentResolver.openOutputStream(android.net.Uri).

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

OpenOutputStream(Uri, String)

Open a stream on to the content associated with a content URI.

[Android.Runtime.Register("openOutputStream", "(Landroid/net/Uri;Ljava/lang/String;)Ljava/io/OutputStream;", "")]
public System.IO.Stream? OpenOutputStream (Android.Net.Uri uri, string mode);
[<Android.Runtime.Register("openOutputStream", "(Landroid/net/Uri;Ljava/lang/String;)Ljava/io/OutputStream;", "")>]
member this.OpenOutputStream : Android.Net.Uri * string -> System.IO.Stream

Parameters

uri
Uri

The desired URI.

mode
String

The string representation of the file mode. Can be "r", "w", "wt", "wa", "rw" or "rwt". Please note the exact implementation of these may differ for each Provider implementation - for example, "w" may or may not truncate.

Returns

an OutputStream or null if the provider recently crashed.

Attributes

Exceptions

if the provided URI could not be opened.

Remarks

Open a stream on to the content associated with a content URI. If there is no data associated with the URI, FileNotFoundException is thrown.

<h5>Accepts the following URI schemes:</h5> <ul> <li>content (#SCHEME_CONTENT)</li> <li>file (#SCHEME_FILE)</li> </ul>

See #openAssetFileDescriptor(Uri, String) for more information on these schemes.

Java documentation for android.content.ContentResolver.openOutputStream(android.net.Uri, java.lang.String).

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.

See also

  • <xref:Android.Content.ContentResolver.OpenAssetFileDescriptor(Android.Net.Uri%2c+System.String)>

Applies to