RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference Class

Definition

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

public sealed class RandomAccessStreamReferencepublic sealed class RandomAccessStreamReferencePublic NotInheritable Class RandomAccessStreamReferencepublic sealed class RandomAccessStreamReference
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

CreateFromFile(IStorageFile) CreateFromFile(IStorageFile) CreateFromFile(IStorageFile) CreateFromFile(IStorageFile)

Creates a random access stream around a file.

public static RandomAccessStreamReference CreateFromFile(IStorageFile file)public static RandomAccessStreamReference CreateFromFile(IStorageFile file)Public Static Function CreateFromFile(file As IStorageFile) As RandomAccessStreamReferencepublic static RandomAccessStreamReference CreateFromFile(IStorageFile file)
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

The file to create a stream around.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CreateFromStream(IRandomAccessStream) CreateFromStream(IRandomAccessStream) CreateFromStream(IRandomAccessStream) CreateFromStream(IRandomAccessStream)

Creates a random access stream around the specified stream.

public static RandomAccessStreamReference CreateFromStream(IRandomAccessStream stream)public static RandomAccessStreamReference CreateFromStream(IRandomAccessStream stream)Public Static Function CreateFromStream(stream As IRandomAccessStream) As RandomAccessStreamReferencepublic static RandomAccessStreamReference CreateFromStream(IRandomAccessStream stream)
Parameters
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CreateFromUri(Uri) CreateFromUri(Uri) CreateFromUri(Uri) CreateFromUri(Uri)

Creates a random access stream around the specified URI.

public static RandomAccessStreamReference CreateFromUri(Uri uri)public static RandomAccessStreamReference CreateFromUri(Uri uri)Public Static Function CreateFromUri(uri As Uri) As RandomAccessStreamReferencepublic static RandomAccessStreamReference CreateFromUri(Uri uri)
Parameters
uri
Uri Uri Uri 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
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 )public IAsyncOperation<IRandomAccessStreamWithContentType> OpenReadAsync()
Returns

The asynchronous operation.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)