IRandomAccessStream interface

Applies to Windows and Windows Phone

Supports random access of data in input and output streams.

Syntax


public interface IRandomAccessStream : IDisposable, 
    IInputStream, IOutputStream

Attributes

[Version(0x06020000)]

Members

The IRandomAccessStream interface has these types of members:

Methods

The IRandomAccessStream interface has these methods. It also inherits methods from the Object class.

MethodDescription
CloneStream Creates a new instance of a IRandomAccessStream over the same resource as the current stream.
GetInputStreamAt Returns an input stream at a specified location in a stream.
GetOutputStreamAt Returns an output stream at a specified location in a stream.
Seek Sets the position of the stream to the specified value.

 

Properties

The IRandomAccessStream interface has these properties.

PropertyAccess typeDescription

CanRead

Read-onlyGets a value that indicates whether the stream can be read from.

CanWrite

Read-onlyGets a value that indicates whether the stream can be written to.

Position

Read-onlyGets the byte offset of the stream.

Size

Read/writeGets or sets the size of the random access 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.

Interface inheritance

IRandomAccessStream inherits IInputStream, and IOutputStream. Types that implement IRandomAccessStream also implement the interface members of IInputStream and IOutputStream.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

See also

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

 

 

Show:
© 2014 Microsoft. All rights reserved.