Random​Access​Stream Random​Access​Stream Random​Access​Stream Random​Access​Stream Class

Definition

Provides random access of data in input and output streams.

public : static class RandomAccessStreampublic static class RandomAccessStreamPublic Static Class RandomAccessStream// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

For more info, see Quickstart: Reading and writing a file, which shows how to read and write bytes to a file by using a RandomAccessStream. To encode an image by using a stream, see Imaging.

Methods

CopyAndCloseAsync(IInputStream, IOutputStream) CopyAndCloseAsync(IInputStream, IOutputStream) CopyAndCloseAsync(IInputStream, IOutputStream) CopyAndCloseAsync(IInputStream, IOutputStream)

Copies a source stream to a destination stream and waits for the copy operation to complete.

public : static IAsyncOperationWithProgress<ulong, ulong> CopyAndCloseAsync(IInputStream source, IOutputStream destination)public static IAsyncOperationWithProgress<ulong, ulong> CopyAndCloseAsync(IInputStream source, IOutputStream destination)Public Static Function CopyAndCloseAsync(source As IInputStream, destination As IOutputStream) As IAsyncOperationWithProgress( Of ulong, ulong )// You can use this method in JavaScript.
Parameters
source
IInputStream IInputStream IInputStream IInputStream

The stream to copy data from.

destination
IOutputStream IOutputStream IOutputStream IOutputStream

The stream to copy data to.

Returns

Remarks

The CopyAndCloseAsync method is similar to CopyAsync but also calls and waits for FlushAsync and Close on the output stream before its asynchronous operation completes.

CopyAsync(IInputStream, IOutputStream) CopyAsync(IInputStream, IOutputStream) CopyAsync(IInputStream, IOutputStream) CopyAsync(IInputStream, IOutputStream)

Copies a source stream to a destination stream.

public : static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination)public static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination)Public Static Function CopyAsync(source As IInputStream, destination As IOutputStream) As IAsyncOperationWithProgress( Of ulong, ulong )// You can use this method in JavaScript.
Parameters
source
IInputStream IInputStream IInputStream IInputStream

The stream to copy data from.

destination
IOutputStream IOutputStream IOutputStream IOutputStream

The stream to copy data to.

Returns
See Also

CopyAsync(IInputStream, IOutputStream, UInt64) CopyAsync(IInputStream, IOutputStream, UInt64) CopyAsync(IInputStream, IOutputStream, UInt64) CopyAsync(IInputStream, IOutputStream, UInt64)

Copies the specified number of bytes from a source stream to a destination stream.

public : static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination, unsigned __int64 bytesToCopy)public static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination, UInt64 bytesToCopy)Public Static Function CopyAsync(source As IInputStream, destination As IOutputStream, bytesToCopy As UInt64) As IAsyncOperationWithProgress( Of ulong, ulong )// You can use this method in JavaScript.
Parameters
source
IInputStream IInputStream IInputStream IInputStream

The stream to copy data from.

destination
IOutputStream IOutputStream IOutputStream IOutputStream

The stream to copy data to.

bytesToCopy
unsigned __int64 UInt64 UInt64 UInt64

The number of bytes to copy.

Returns
See Also

See Also