StreamExtensions.Read 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
| Read(Stream, Span<Byte>) | |
| Read<T>(Stream) |
Reads a value of a specified type from a source Stream instance. |
Read(Stream, Span<Byte>)
- Source:
- StreamExtensions.cs
public static int Read(this System.IO.Stream stream, Span<byte> buffer);
static member Read : System.IO.Stream * Span<byte> -> int
<Extension()>
Public Function Read (stream As Stream, buffer As Span(Of Byte)) As Integer
Parameters
- stream
- Stream
Returns
Applies to
Read<T>(Stream)
- Source:
- StreamExtensions.cs
Reads a value of a specified type from a source Stream instance.
public static T Read<T>(this System.IO.Stream stream) where T : struct;
static member Read : System.IO.Stream -> 'T (requires 'T : struct)
<Extension()>
Public Function Read(Of T As Structure) (stream As Stream) As T
Type Parameters
- T
The type of value to read.
Parameters
Returns
The T value read from stream.
Exceptions
Thrown if stream reaches the end.