Class FileStreamContainer

Class FileStreamContainer

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)

Helper for file stream processing.

[JsonObject(MemberSerialization.OptIn)]
public sealed class FileStreamContainer : StreamContainer, IDisposable

Inheritance

objectDisposableObjectStreamContainerFileStreamContainer

Implements

IDisposable

Inherited Members

StreamContainer.ReadWriteBytesCount, StreamContainer.Flush(), StreamContainer.Write(byte[]), StreamContainer.WriteByte(byte), StreamContainer.Read(byte[]), StreamContainer.ToBytes(), StreamContainer.ToBytes(long, long), StreamContainer.Read(byte[], int, int), StreamContainer.ReadByte(), StreamContainer.Seek(long, SeekOrigin), StreamContainer.SeekBegin(), StreamContainer.Write(byte[], int, int), StreamContainer.Save(Stream), StreamContainer.Save(Stream, int), StreamContainer.Save(Stream, int, long), StreamContainer.Save(string), StreamContainer.Save(string, int), StreamContainer.Save(string, int, long), StreamContainer.WriteTo(StreamContainer), StreamContainer.WriteTo(StreamContainer, long), StreamContainer.SyncRoot, StreamContainer.Position, StreamContainer.Stream, StreamContainer.IsStreamDisposedOnClose, StreamContainer.Length, StreamContainer.CanRead, StreamContainer.CanSeek, StreamContainer.CanWrite, DisposableObject.Dispose(), DisposableObject.Disposed, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

FilePath

Gets the file path.

public string FilePath { get; }

Property Value

string

IsCreated

Gets a value indicating whether stream was created explicitly.

public bool IsCreated { get; }

Property Value

bool

IsTemporal

Gets or sets a value indicating whether stream is temporal.

public bool IsTemporal { get; set; }

Property Value

bool

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)

Called before save occurs on the destination stream.

protected override void BeforeSave(Stream destinationStream)

Parameters

destinationStream Stream

The destination stream.

CreateFileStream(string, bool)

Creates a new file stream.

public static FileStreamContainer CreateFileStream(string fileLocation, bool isTemporal)

Parameters

fileLocation string

The file location.

isTemporal bool

If 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 string

The file location.

Returns

FileStreamContainer

The file stream container.

Operators

explicit operator Stream(FileStreamContainer)

Performs an explicit conversion from Aspose.Imaging.FileStreamContainer to System.IO.Stream.

public static explicit operator Stream(FileStreamContainer fileStreamContainer)

Parameters

fileStreamContainer FileStreamContainer

The file stream container.

Returns

Stream

The result of the conversion.

explicit operator FileStream(FileStreamContainer)

Performs an explicit conversion from Aspose.Imaging.FileStreamContainer to System.IO.FileStream.

public static explicit operator FileStream(FileStreamContainer fileStreamContainer)

Parameters

fileStreamContainer FileStreamContainer

The file stream container.

Returns

FileStream

The result of the conversion.