Share via


Channels.NewOutputStream Method

Definition

Overloads

NewOutputStream(IAsynchronousByteChannel)

Constructs a stream that writes bytes to the given channel.

NewOutputStream(IWritableByteChannel)

Constructs a stream that writes bytes to the given channel.

NewOutputStream(IAsynchronousByteChannel)

Constructs a stream that writes bytes to the given channel.

[Android.Runtime.Register("newOutputStream", "(Ljava/nio/channels/AsynchronousByteChannel;)Ljava/io/OutputStream;", "", ApiSince=26)]
public static System.IO.Stream? NewOutputStream (Java.Nio.Channels.IAsynchronousByteChannel? ch);
[<Android.Runtime.Register("newOutputStream", "(Ljava/nio/channels/AsynchronousByteChannel;)Ljava/io/OutputStream;", "", ApiSince=26)>]
static member NewOutputStream : Java.Nio.Channels.IAsynchronousByteChannel -> System.IO.Stream

Parameters

ch
IAsynchronousByteChannel

The channel to which bytes will be written

Returns

A new output stream

Attributes

Remarks

Constructs a stream that writes bytes to the given channel.

The stream will not be buffered. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.

Added in 1.7.

Java documentation for java.nio.channels.Channels.newOutputStream(java.nio.channels.AsynchronousByteChannel).

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

NewOutputStream(IWritableByteChannel)

Constructs a stream that writes bytes to the given channel.

[Android.Runtime.Register("newOutputStream", "(Ljava/nio/channels/WritableByteChannel;)Ljava/io/OutputStream;", "")]
public static System.IO.Stream? NewOutputStream (Java.Nio.Channels.IWritableByteChannel? ch);
[<Android.Runtime.Register("newOutputStream", "(Ljava/nio/channels/WritableByteChannel;)Ljava/io/OutputStream;", "")>]
static member NewOutputStream : Java.Nio.Channels.IWritableByteChannel -> System.IO.Stream

Parameters

ch
IWritableByteChannel

The channel to which bytes will be written

Returns

A new output stream

Attributes

Remarks

Constructs a stream that writes bytes to the given channel.

The write methods of the resulting stream will throw an IllegalBlockingModeException if invoked while the underlying channel is in non-blocking mode. The stream will not be buffered. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.

Java documentation for java.nio.channels.Channels.newOutputStream(java.nio.channels.WritableByteChannel).

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