Skip to content

IOFile Class

Definition

Base class for a file of a given format.

public abstract class IOFile

View source

Constructors

Name Description
IOFile(IOFileFormat) Initializes a new instance of the IOFile class.

Properties

Name Description
Format Gets the format of this file.

Methods

Name Description
GetCompressedFilename(String, CompressionFormat) Gets the filename to use for a file written with the specified compression format, for example "name.wav" compressed with GZip becomes "name.wav.gz".
LoadInto(Span<Byte>) Loads the file data into the specified memory span.
Save(String, String, CompressionFormat) Saves this file to a directory with the specified name.
SaveAsync(String, String, CompressionFormat, CancellationToken) Saves this file to a directory with the specified name asynchronously
ToByteArray() Converts this file to a byte array.
TryLoadInto(Span<Byte>) Attempts to load the file data into the specified memory span.
Write(Stream) Writes this file to a stream.
Write(Stream, String, CompressionFormat) Writes this file to a stream, optionally compressing it.
WriteAsync(Stream, CancellationToken) Writes this file to a stream asynchronously.
WriteAsync(Stream, String, CompressionFormat, CancellationToken) Writes this file to a stream asynchronously, optionally compressing it.