RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference Class

Provides random access of data in input and output streams for a file.

Syntax

Declaration

public sealed class RandomAccessStreamReferencepublic sealed class RandomAccessStreamReferencePublic NotInheritable Class RandomAccessStreamReference

Methods summary

Creates a random access stream around a file.

Creates a random access stream around the specified stream.

Creates a random access stream around the specified URI.

Opens a stream for random access.

Methods

  • CreateFromFile(Windows.Storage.IStorageFile)
    CreateFromFile(Windows.Storage.IStorageFile)
    CreateFromFile(Windows.Storage.IStorageFile)
    CreateFromFile(Windows.Storage.IStorageFile)

    Creates a random access stream around a file.

    public static RandomAccessStreamReference CreateFromFile(Windows.Storage.IStorageFile file)public static RandomAccessStreamReference CreateFromFile(Windows.Storage.IStorageFile file)Public Static Function CreateFromFile(file As Windows.Storage.IStorageFile) As RandomAccessStreamReference

    Parameters

    Returns

  • CreateFromStream(Windows.Storage.Streams.IRandomAccessStream)
    CreateFromStream(Windows.Storage.Streams.IRandomAccessStream)
    CreateFromStream(Windows.Storage.Streams.IRandomAccessStream)
    CreateFromStream(Windows.Storage.Streams.IRandomAccessStream)

    Creates a random access stream around the specified stream.

    public static RandomAccessStreamReference CreateFromStream(Windows.Storage.Streams.IRandomAccessStream stream)public static RandomAccessStreamReference CreateFromStream(Windows.Storage.Streams.IRandomAccessStream stream)Public Static Function CreateFromStream(stream As Windows.Storage.Streams.IRandomAccessStream) As RandomAccessStreamReference

    Parameters

    Returns

  • CreateFromUri(Windows.Foundation.Uri)
    CreateFromUri(Windows.Foundation.Uri)
    CreateFromUri(Windows.Foundation.Uri)
    CreateFromUri(Windows.Foundation.Uri)

    Creates a random access stream around the specified URI.

    public static RandomAccessStreamReference CreateFromUri(Windows.Foundation.Uri uri)public static RandomAccessStreamReference CreateFromUri(Windows.Foundation.Uri uri)Public Static Function CreateFromUri(uri As Windows.Foundation.Uri) As RandomAccessStreamReference

    Parameters

    • uri

      The Uniform Resource Identifier (URI) to create the stream around. The valid Uniform Resource Identifier (URI) schemes are http, https, ms-appx, and ms-appdata.

    Returns

  • OpenReadAsync()
    OpenReadAsync()
    OpenReadAsync()
    OpenReadAsync()

    Opens a stream for random access.

    public IAsyncOperation<IRandomAccessStreamWithContentType> OpenReadAsync()public IAsyncOperation<IRandomAccessStreamWithContentType> OpenReadAsync()Public Function OpenReadAsync() As IAsyncOperation( Of IRandomAccessStreamWithContentType )

    Returns

    • The asynchronous operation.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Storage.Streams.dll