Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

WindowsRuntimeStreamExtensions.AsRandomAccessStream(Stream) Method

Definition

Namespace:
System.IO
Assembly:
System.Runtime.WindowsRuntime.dll

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.

Important

This API is not CLS-compliant.

Converts the specified stream to a random access stream.

public:
[System::Runtime::CompilerServices::Extension]
 static Windows::Storage::Streams::IRandomAccessStream ^ AsRandomAccessStream(System::IO::Stream ^ stream);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IRandomAccessStream AsRandomAccessStream(this System.IO.Stream stream);
[<System.CLSCompliant(false)>]
static member AsRandomAccessStream : System.IO.Stream -> Windows.Storage.Streams.IRandomAccessStream
<Extension()>
Public Function AsRandomAccessStream (stream As Stream) As IRandomAccessStream

Parameters

stream
Stream

The stream to convert.

Returns

Windows.Storage.Streams.IRandomAccessStream

A Windows Runtime Windows.Storage.Streams.IRandomAccessStream, which represents the converted stream.

Attributes

Remarks

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).

Applies to


Feedback

Was this page helpful?