Windows apps
Collapse the table of content
Expand the table of content

WindowsRuntimeStreamExtensions::AsRandomAccessStream Method

.NET Framework (current version)

Converts the specified stream to a random access stream.

This API is not CLS-compliant. 

Namespace:  System.IO
Assembly:  System.Runtime.WindowsRuntime (in System.Runtime.WindowsRuntime.dll)

[CLSCompliantAttribute(false)]
[ExtensionAttribute]
public:
static IRandomAccessStream^ AsRandomAccessStream(
	Stream^ stream
)

Parameters

stream
Type: System.IO::Stream

The stream to convert.

Return Value

Type: IRandomAccessStream
A Windows Runtime RandomAccessStream, which represents the converted stream.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework

Supported in: 4.6
Show:
© 2017 Microsoft