Table of Contents

Class FileStreamProvider

Namespace
CarinaStudio.IO
Assembly
CarinaStudio.AppBase.Core.dll

Implementation of IStreamProvider based-on file.

public class FileStreamProvider : IStreamProvider
Inheritance
FileStreamProvider
Implements
Inherited Members
Extension Methods

Constructors

FileStreamProvider(string, bool)

Initialize new FileStreamProvider instance.

public FileStreamProvider(string fileName, bool append = false)

Parameters

fileName string

File name.

append bool

True to open file in Append mode.

Properties

FileName

Get file name.

public string FileName { get; }

Property Value

string

Methods

CheckStreamAccess(StreamAccess)

Check whether given access to Stream is supported by this provider or not.

public bool CheckStreamAccess(StreamAccess access)

Parameters

access StreamAccess

Access to stream.

Returns

bool

True if given combination of access is supported.

OpenStreamAsync(StreamAccess, CancellationToken)

Open stream asynchronously.

public Task<Stream> OpenStreamAsync(StreamAccess access, CancellationToken token)

Parameters

access StreamAccess

Desired access to stream.

token CancellationToken

Cancellation token.

Returns

Task<Stream>

Task of opening stream.