Class MtFileStream
- Namespace
- SharpPluginLoader.Core.IO
- Assembly
- SharpPluginLoader.Core.dll
Represents a file stream.
public class MtFileStream : MtStream, IDisposable
- Inheritance
-
MtFileStream
- Implements
- Inherited Members
Constructors
MtFileStream()
public MtFileStream()
MtFileStream(nint)
public MtFileStream(nint instance)
Parameters
instance
nint
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~MtFileStream()
protected ~MtFileStream()
FromFile(MtFile)
Creates a new file stream from the specified file.
public static MtFileStream? FromFile(MtFile file)
Parameters
file
MtFileThe file to create the stream from.
Returns
- MtFileStream
The created file stream, or null if the file stream could not be created.
FromPath(string, OpenMode, bool)
Opens a file stream from the specified path.
public static MtFileStream? FromPath(string path, OpenMode mode, bool createPath = true)
Parameters
path
stringThe path of the file.
mode
OpenModeThe mode to open the file in.
createPath
boolWhether to create the path if it does not exist.
Returns
- MtFileStream
The opened file stream, or null if the file stream could not be opened.
Write(string, Encoding?)
Writes the given string to the stream.
public long Write(string str, Encoding? encoding = null)
Parameters
Returns
- long
The number of bytes written.