Share via


IRandomAccessStream Interface

Definition

Supports random access of data in input and output streams.

public interface class IRandomAccessStream : IClosable, IInputStream, IOutputStream
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2421821409, 48211, 4575, 140, 73, 0, 30, 79, 198, 134, 218)]
struct IRandomAccessStream : IClosable, IInputStream, IOutputStream
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(2421821409, 48211, 4575, 140, 73, 0, 30, 79, 198, 134, 218)]
public interface IRandomAccessStream : System.IDisposable, IInputStream, IOutputStream
Public Interface IRandomAccessStream
Implements IDisposable, IInputStream, IOutputStream
Derived
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

For more info, see Quickstart: Reading and writing files, 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.

Properties

CanRead

Gets a value that indicates whether the stream can be read from.

CanWrite

Gets a value that indicates whether the stream can be written to.

Position

Gets the byte offset of the stream.

Size

Gets or sets the size of the random access stream.

Methods

CloneStream()

Creates a new instance of a IRandomAccessStream over the same resource as the current stream.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FlushAsync()

Flushes data asynchronously in a sequential stream.

(Inherited from IOutputStream)
GetInputStreamAt(UInt64)

Returns an input stream at a specified location in a stream.

GetOutputStreamAt(UInt64)

Returns an output stream at a specified location in a stream.

ReadAsync(IBuffer, UInt32, InputStreamOptions)

Reads data from the stream asynchronously.

(Inherited from IInputStream)
Seek(UInt64)

Sets the position of the stream to the specified value.

WriteAsync(IBuffer)

Writes data asynchronously in a sequential stream.

(Inherited from IOutputStream)

Applies to

See also