Channels.NewInputStream Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.
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
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.
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.