Compartilhar via


Channels.NewInputStream Method

Definition

Overloads

NewInputStream(IAsynchronousByteChannel)

Constructs a stream that reads bytes from the given channel.

NewInputStream(IReadableByteChannel)

Constructs a stream that reads bytes from the given channel.

NewInputStream(IAsynchronousByteChannel)

Constructs a stream that reads bytes from the given channel.

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

Parameters

ch
IAsynchronousByteChannel

The channel from which bytes will be read

Returns

A new input stream

Attributes

Remarks

Constructs a stream that reads bytes from the given channel.

The stream will not be buffered, and it will not support the InputStream#mark mark or InputStream#reset reset methods. 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.newInputStream(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

NewInputStream(IReadableByteChannel)

Constructs a stream that reads bytes from the given channel.

[Android.Runtime.Register("newInputStream", "(Ljava/nio/channels/ReadableByteChannel;)Ljava/io/InputStream;", "")]
public static System.IO.Stream? NewInputStream (Java.Nio.Channels.IReadableByteChannel? ch);
[<Android.Runtime.Register("newInputStream", "(Ljava/nio/channels/ReadableByteChannel;)Ljava/io/InputStream;", "")>]
static member NewInputStream : Java.Nio.Channels.IReadableByteChannel -> System.IO.Stream

Parameters

ch
IReadableByteChannel

The channel from which bytes will be read

Returns

A new input stream

Attributes

Remarks

Constructs a stream that reads bytes from the given channel.

The read 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, and it will not support the InputStream#mark mark or InputStream#reset reset methods. 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.newInputStream(java.nio.channels.ReadableByteChannel).

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