Table of contents
Collapse the table of content
Expand the table of content

Stream.AsyncRead Extension Method (F#)

Den Delimarsky|Last Updated: 8/18/2017
1 Contributor

Returns an asynchronous computation that will read from the stream into the given buffer.

Namespace/Module Path: Microsoft.FSharp.Control.CommonExtensions

Assembly: FSharp.Core (in FSharp.Core.dll)


// Signatures:
type System.IO.Stream with
member AsyncRead : byte [] * ?int * ?int -> Async<int>
type System.IO.Stream with
member AsyncRead : int -> Async<byte []>

// Usage:
stream.AsyncRead (buffer)
stream.AsyncRead (count)


buffer Type: byte[]

The buffer to read into.

offset Type: int

An optional offset as a number of bytes in the stream.

count Type: int

An optional number of bytes to read from the stream.


ArgumentExceptionThrown when the sum of offset and count is longer than the buffer length.
ArgumentOutOfRangeExceptionThrown when offset or count is negative.


This member is named AsyncRead in compiled assemblies. If you are accessing the method from a language other than F#, or through reflection, use this name.


Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0

See Also

Control.CommonExtensions Module (F#)

© 2020 Microsoft