FileRandomAccessStream FileRandomAccessStream FileRandomAccessStream FileRandomAccessStream FileRandomAccessStream Class

Definition

Supports reading and writing to a file at a specified position.

public : sealed class FileRandomAccessStream : IClosable, IInputStream, IOutputStream, IRandomAccessStream
struct winrt::Windows::Storage::Streams::FileRandomAccessStream : IClosable, IInputStream, IOutputStream, IRandomAccessStream
public sealed class FileRandomAccessStream : IDisposable, IInputStream, IOutputStream, IRandomAccessStream
Public NotInheritable Class FileRandomAccessStream Implements IDisposable, IInputStream, IOutputStream, IRandomAccessStream
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

CanRead CanRead CanRead CanRead CanRead

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

CanWrite CanWrite CanWrite CanWrite CanWrite

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

Position Position Position Position Position

Gets the byte offset of the stream.

Size Size Size Size Size

Gets or sets the size of the random access stream.

Methods

CloneStream() CloneStream() CloneStream() CloneStream() CloneStream()

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

Close() Close() Close() Close() Close()

Closes the current stream and releases system resources.

Dispose() Dispose() Dispose() Dispose() Dispose()

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

FlushAsync() FlushAsync() FlushAsync() FlushAsync() FlushAsync()

Flushes data asynchronously in a sequential stream.

GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64) GetInputStreamAt(UInt64)

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

GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64) GetOutputStreamAt(UInt64)

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

OpenAsync(String, FileAccessMode) OpenAsync(String, FileAccessMode) OpenAsync(String, FileAccessMode) OpenAsync(String, FileAccessMode) OpenAsync(String, FileAccessMode)

Opens a stream to an existing file given the file's path.

OpenAsync(String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenAsync(String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenAsync(String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenAsync(String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenAsync(String, FileAccessMode, StorageOpenOptions, FileOpenDisposition)

Opens a stream to a file given a file path. If the file does not exist, it can be created using FileOpenDisposition.

OpenForUserAsync(User, String, FileAccessMode) OpenForUserAsync(User, String, FileAccessMode) OpenForUserAsync(User, String, FileAccessMode) OpenForUserAsync(User, String, FileAccessMode) OpenForUserAsync(User, String, FileAccessMode)

Opens a stream for a user to an existing file given the file path and the user's information.

OpenForUserAsync(User, String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenForUserAsync(User, String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenForUserAsync(User, String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenForUserAsync(User, String, FileAccessMode, StorageOpenOptions, FileOpenDisposition) OpenForUserAsync(User, String, FileAccessMode, StorageOpenOptions, FileOpenDisposition)

Opens a stream for a user to a file given a file path and the user's information. If the file does not exist, it can be created using FileOpenDisposition.

OpenTransactedWriteAsync(String) OpenTransactedWriteAsync(String) OpenTransactedWriteAsync(String) OpenTransactedWriteAsync(String) OpenTransactedWriteAsync(String)

Opens a stream for writing to an existing file given the file's path.

OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition)

Opens a stream for writing to a file given a file path. If the file does not exist, it can be created using FileOpenDisposition.

OpenTransactedWriteForUserAsync(User, String) OpenTransactedWriteForUserAsync(User, String) OpenTransactedWriteForUserAsync(User, String) OpenTransactedWriteForUserAsync(User, String) OpenTransactedWriteForUserAsync(User, String)

Opens a writable stream for a user to an existing file given the file's path and the user's information.

OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition) OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition)

Opens a writable stream for a user to a file given a file path and the user's information. If the file does not exist, it can be created using FileOpenDisposition.

ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions) ReadAsync(IBuffer, UInt32, InputStreamOptions)

Returns an asynchronous byte reader object.

Seek(UInt64) Seek(UInt64) Seek(UInt64) Seek(UInt64) Seek(UInt64)

Sets the position of the stream to the specified value.

WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer) WriteAsync(IBuffer)

Writes data asynchronously to a file.

See Also