Class FileStreamContainer
Helper for file stream processing.
public sealed class FileStreamContainer : StreamContainer, IDisposable
- Inheritance
-
FileStreamContainer
- Implements
- Inherited Members
Properties
FilePath
Gets the file path.
public string FilePath { get; }
Property Value
- string
The file path.
IsCreated
Gets a value indicating whether stream was created explicitly.
public bool IsCreated { get; }
Property Value
- bool
true
if stream was created explicitly; otherwise,false
.
IsTemporal
Gets or sets a value indicating whether stream is temporal.
public bool IsTemporal { get; set; }
Property Value
- bool
true
if stream is temporal; otherwise,false
.
Remarks
A temporal stream will remove iself when disposed. If the stream is memory based this property has no effect. The stream can be marked as temporal or persistent in case it was created explicitly otherwise the appropriate exception is thrown.
Methods
AfterStreamDisposed()
Called after the stream is disposed.
protected override void AfterStreamDisposed()
BeforeSave(Stream)
protected override void BeforeSave(Stream destinationStream)
Parameters
destinationStream
Stream
CreateFileStream(string, bool)
Creates a new file stream.
public static FileStreamContainer CreateFileStream(string fileLocation, bool isTemporal)
Parameters
fileLocation
stringThe file location.
isTemporal
boolIf set to
true
the file stream container is temporal.
Returns
- FileStreamContainer
The file stream container.
OpenFileStream(string)
Opens an existing file stream. If file stream does not exist the appropriate exception is thrown.
public static FileStreamContainer OpenFileStream(string fileLocation)
Parameters
fileLocation
stringThe file location.
Returns
- FileStreamContainer
The file stream container.
Operators
explicit operator FileStream(FileStreamContainer)
Performs an explicit conversion from FileStreamContainer to FileStream.
public static explicit operator FileStream(FileStreamContainer fileStreamContainer)
Parameters
fileStreamContainer
FileStreamContainerThe file stream container.
Returns
- FileStream
The result of the conversion.
explicit operator Stream(FileStreamContainer)
Performs an explicit conversion from FileStreamContainer to Stream.
public static explicit operator Stream(FileStreamContainer fileStreamContainer)
Parameters
fileStreamContainer
FileStreamContainerThe file stream container.
Returns
- Stream
The result of the conversion.