FileRandomAccessStream Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Supports reading and writing to a file at a specified position.
public ref class FileRandomAccessStream sealed : IClosable, IRandomAccessStream
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileRandomAccessStream final : IClosable, IRandomAccessStream
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileRandomAccessStream : System.IDisposable, IRandomAccessStream
Public NotInheritable Class FileRandomAccessStream
Implements IDisposable, IRandomAccessStream
- Inheritance
- Attributes
- Implements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Windows version | SDK version | Value added |
---|---|---|
1709 | 16299 | OpenAsync(String,FileAccessMode) |
1709 | 16299 | OpenAsync(String,FileAccessMode,StorageOpenOptions,FileOpenDisposition) |
1709 | 16299 | OpenForUserAsync(User,String,FileAccessMode) |
1709 | 16299 | OpenForUserAsync(User,String,FileAccessMode,StorageOpenOptions,FileOpenDisposition) |
1709 | 16299 | OpenTransactedWriteAsync(String) |
1709 | 16299 | OpenTransactedWriteAsync(String,StorageOpenOptions,FileOpenDisposition) |
1709 | 16299 | OpenTransactedWriteForUserAsync(User,String) |
1709 | 16299 | OpenTransactedWriteForUserAsync(User,String,StorageOpenOptions,FileOpenDisposition) |
Can |
Gets a value that indicates whether the stream can be read from. |
Can |
Gets a value that indicates whether the file can be written to. |
Position |
Gets the byte offset of the stream. |
Size |
Gets or sets the size of the random access stream. |
Clone |
Creates a new instance of a IRandomAccessStream over the same resource as the current stream. |
Close() |
Closes the current stream and releases system resources. |
Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
Flush |
Flushes data asynchronously in a sequential stream. |
Get |
Returns an input stream at a specified location in a stream. |
Get |
Returns an output stream at a specified location in a stream. |
Open |
Opens a stream to a file given a file path. If the file does not exist, it can be created using FileOpenDisposition. |
Open |
Opens a stream to an existing file given the file's path. |
Open |
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. |
Open |
Opens a stream for a user to an existing file given the file path and the user's information. |
Open |
Opens a stream for writing to a file given a file path. If the file does not exist, it can be created using FileOpenDisposition. |
Open |
Opens a stream for writing to an existing file given the file's path. |
Open |
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. |
Open |
Opens a writable stream for a user to an existing file given the file's path and the user's information. |
Read |
Returns an asynchronous byte reader object. |
Seek(UInt64) |
Sets the position of the stream to the specified value. |
Write |
Writes data asynchronously to a file. |