Windows Dev Center

RandomAccessStream class

Provides random access of data in input and output streams.

Syntax


Public NotInheritable Class RandomAccessStream

Members

The RandomAccessStream class has these types of members:

Methods

The RandomAccessStream class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
CopyAndCloseAsync Copies a source stream to a destination stream and waits for the copy operation to complete.
CopyAsync(IInputStream, IOutputStream) Copies a source stream to a destination stream.
CopyAsync(IInputStream, IOutputStream, UInt64) Copies the specified number of bytes from a source stream to a destination stream.

 

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 How to encode a new image.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Storage.Streams
Windows::Storage::Streams [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage.Streams
Windows::Storage::Streams [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Muse()]
[Version(0x06020000)]

See also

Object
How to encode a new image
Reading and writing data sample
FileRandomAccessStream
InMemoryRandomAccessStream
RandomAccessStreamOverStream
RandomAccessStreamReference

 

 

Show:
© 2015 Microsoft