RandomAccessStream RandomAccessStream RandomAccessStream RandomAccessStream Class

Provides random access of data in input and output streams.

Syntax

Declaration

public static class RandomAccessStreampublic static class RandomAccessStreamPublic Static Class RandomAccessStreampublic static class RandomAccessStream

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 summary

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

Copies a source stream to a destination stream.

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

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 )public static IAsyncOperationWithProgress<ulong, ulong> CopyAndCloseAsync(IInputStream source, IOutputStream destination)

    Parameters

    Returns

    • The asynchronous operation.

    Remarks

    The CopyAndCloseAsync(IInputStream, IOutputStream) method is similar to CopyAsync(IInputStream, IOutputStream) 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 )public static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination)

    Parameters

    Returns

    • The asynchronous operation.

  • 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, UInt64 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 )public static IAsyncOperationWithProgress<ulong, ulong> CopyAsync(IInputStream source, IOutputStream destination, UInt64 bytesToCopy)

    Parameters

    Returns

    • The asynchronous operation.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

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

Details

Assembly

Windows.Storage.Streams.dll