Stream.AsyncRead Extension Method (F#)
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)
Parameters
-
The buffer to read into.
offset
Type: intAn optional offset as a number of bytes in the stream.
count
Type: intAn optional number of bytes to read from the stream.
Exceptions
Exception |
Description |
---|---|
Thrown when the sum of offset and count is longer than the buffer length. |
|
Thrown when offset or count is negative. |
Remarks
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.
Platforms
Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2
Version Information
F# Runtime
Supported in: 2.0
Silverlight
Supported in: 3